This excerpt is taken from the book of Sheikh al-Islam Imam Ibn Taymiyyah, may Allah have mercy on him, Al-Jawab al-Bahir fi Zuwar al-Maqabir, translated by Sheikh Ataullah Saqib.
The Method of Sending Salutations at the Blessed Grave
In Muwatta Malik, there is a narration from Abdullah bin Umar (may Allah be pleased with them both) that when he used to come near the Noble Grave, he would say and then leave:
السَّلَامُ عَلَيْكَ يَا رَسُولَ اللَّهِ السَّلَامُ عَلَيْكَ يَا أَبَا بَكْرٍ السَّلَامُ عَلَيْكَ يَا أَبَتِ
"O Messenger of Allah! Peace be upon you! O Abu Bakr! Peace be upon you! O Abu Jan! Peace be upon you!"
Reference: (Muwatta Imam Malik 166/1 Book of Shortening Prayer during Travel)
In one narration, it is specified that when Ibn Umar (may Allah be pleased with them both) returned from a journey, he would go to the Noble Grave and offer greetings.
Relying on this narration of Ibn Umar (may Allah be pleased with them both), Imam Malik (may Allah have mercy on him) also says that a person can go near the blessed chamber. According to Imam Malik (may Allah have mercy on him), standing for a long time near the Noble Grave and continuously reciting prayers, blessings, and salutations is disliked and an innovation. None of the pious predecessors of the Ummah did this. Also, the reform of the Ummah is possible only in the way the Muslims of the early generations were reformed.
Traveling to the graves of the Prophets (peace be upon them) and the righteous of the Ummah was not a practice until the time of Imam Malik (may Allah have mercy on him). Rather, this innovation became widespread after the era of the Companions (may Allah be pleased with them), the Followers, and the Followers of the Followers. Because there are commendatory words of the Messenger of Allah (peace and blessings be upon him) about these three eras. After these three eras, this innovation, falsehood, and polytheism were allowed to flourish.
Imam Malik (may Allah have mercy on him) was asked: "A person vowed that he would go to the Noble Grave."
What is your opinion about this? The Imam replied: "If he intended the mosque, then he should fulfill his vow and go to the mosque and offer prayer."
And if his intention was only to visit the Noble Grave, then he should abandon his intention, because the Messenger of Allah (peace and blessings be upon him) said:
لا تعمل المطى إلا إلى ثلاثة مساجد
"Do not ride to any mosque except these three mosques."
Whoever goes to visit the graves of the Prophets (peace be upon them) and the righteous to call upon them or seek their prayers, or holds the belief that prayers are accepted quickly near their graves, such beliefs and actions were not known in the time of Imam Malik (may Allah have mercy on him). Even near the Noble Grave, such actions did not exist. When standing for a long time near the Noble Grave for prayers, blessings, and salutations was considered disliked and an innovation, then what can be said about a person who neither intends to say blessings and salutations nor raises hands for prayer, but on the contrary, seeks prayers from the Messenger of Allah (peace and blessings be upon him), desires relief from difficulties from him, raises his voice near the Noble Grave causing distress to the Messenger of Allah (peace and blessings be upon him), and commits shirk with Allah and wrongs himself?