the Muslim Imams; on the contrary, praying in mosques that contain no grave (1) of any prophet, righteous person, or anyone else is better than praying in mosques (2) that do, by unanimous agreement of the Muslim scholars. Indeed, praying in mosques (3) built over graves is either prohibited or, at the very least, (4) discouraged.
As for an innovated visit (bidʿa): this is when the visitor’s aim (5) is to seek his needs from the deceased, to make supplication at the grave, or to invoke the deceased in supplication. Such conduct is not part of the Sunnah of the Prophet ﷺ, nor did any of the early generations (6) of the ummah consider it desirable; rather, it is one of the condemned innovations, unanimously forbidden by the early scholars of the ummah (7) and its leading Imams.
Mālik and others even disliked a person’s saying, “I have visited the grave of the Prophet ﷺ,” (8) for this wording was never transmitted from the Prophet ﷺ himself. Instead, the hadiths cited on this topic include statements such as: “Whoever visits me and visits my father (9) Abraham in the same year…”