Abū al-Walīd al-Bājī said:
“He thus distinguished between the residents of Medina and visitors from elsewhere, because the visitors came for that purpose, whereas the residents live there and did not come to Medina for the sake of the grave and offering greetings.”
He said:
The Messenger of Allah, may Allah bless him and grant him peace, said:
“O Allah, do not let my grave become an idol that is worshipped.”
“Allah’s wrath was severe against people who took the graves of their prophets as places of worship.”
He said:
The Prophet, may Allah bless him and grant him peace, also said:
“Do not make my grave an ʿīd (festival).”
He continued:
“From the book of Ahmad ibn Shuʿba: Whoever stands at the grave should not press himself against it, touch it, or remain standing beside it for long. In al-ʿUtbiyya—meaning the report from Mālik—it states:
‘In the Prophet’s mosque, may Allah bless him and grant him peace, one should begin with prayer before offering greetings. The preferred place for voluntary prayer there is where the Prophet, may Allah bless him and grant him peace, used to pray, beside the perfumed pillar. For obligatory prayer, however, one should move forward to the front rows.’”
He said:
“For visitors from elsewhere, I prefer voluntary prayer in that mosque to voluntary prayer in their lodgings.”
These statements of Mālik and his followers, together with what they transmitted from the Companions, show that they went to the grave only to greet the Prophet, may Allah bless him and grant him peace, and supplicate for him. Mālik disliked standing there for a prolonged period for that purpose. He also disliked the residents of Medina doing this whenever they entered or left the mosque. Rather, this is done by visitors from elsewhere and by those returning from a journey or setting out on one, for it is a greeting to the Prophet, may Allah bless him and grant him peace.
If, however, a person intends to supplicate for himself, he should do so in the Prophet’s mosque, facing the qiblah, as they reported from the Prophet’s Companions, may Allah bless him and grant him peace. It has not been transmitted that any Companion did this at the grave, or even stood there for a prolonged period supplicating for the Prophet, may Allah bless him and grant him peace. How much less, then, would he do so to supplicate for himself?