Visiting the Prophet’s Mosque and the Blessed Grave:
The journey made to visit the Prophet’s Mosque is recommended. Therefore, according to all the leading imams, it is necessary to shorten the prayer on this journey. It is not reported from any imam that the full prayer is to be prayed, nor is it reported from any imam that travelling to visit the Prophet’s Mosque is prohibited. The one who visits the Prophet’s Mosque will also have visited the honoured grave. If we say that visiting the honoured grave is among the most excellent of deeds, it would not be out of place. Nothing in my writing or in the writing of any other scholar proves a denial of this. The legal status of visiting the graves of the prophets, the righteous of the Ummah (may Allah have mercy on them) and other people is accepted; rather, we have declared visiting graves to be recommended, and the Messenger of Allah ﷺ himself used to go to visit the graves of Jannat al-Baqi’ and of the martyrs of Uhud.
The supplication for visiting graves:
He ﷺ would also instruct the Companions to recite the following supplication when going to a graveyard:
السَّلَامُ عَلَيْكُمْ أَهْلَ الدِّيَارِ مِنَ الْمُؤْمِنِينَ وَالْمُسْلِمِينَ، وَإِنَّا إِنْ شَاءَ اللَّهُ بِكُمْ لَاحِقُونَ، وَيَرْحَمُ اللَّهُ الْمُسْتَقْدِمِينَ مِنَّا وَمِنْكُمْ وَالْمُسْتَأْخِرِينَ، وَنَسْأَلُ اللَّهَ لَنَا وَلَكُمُ الْعَافِيَةَ، اللَّهُمَّ لَا تَحْرِمْنَا أَجْرَهُمْ وَلَا تَفْتِنَّا بَعْدَهُمْ وَاغْفِرْ لَنَا وَلَهُمْ
“O Muslims and believers! Peace be upon you from Allah. We too, Allah willing, will be joining you. May Allah have mercy on you and on all of us. We ask Allah for well-being for ourselves and for you. O Allah! Do not deprive us of their reward, and do not put us to trial after them. O Allah! Forgive them and all of us.”
Visiting the blessed grave, and sending blessings and peace:
When visiting the graves of ordinary people is accepted in the Islamic Shari’ah, then visiting the graves of the prophets and the righteous of the Ummah (may Allah have mercy on them) is established all the more. However, regarding the Messenger of Allah ﷺ, we are commanded to send blessings and peace upon the Messenger of Allah ﷺ during prayer, the adhan, when entering and leaving the Prophet’s Mosque and all other mosques, and whenever making any supplication. So everyone who enters the Prophet’s Mosque must send blessings and peace upon the Messenger of Allah ﷺ.
Travelling to visit the Prophet’s Mosque is legislated, but the scholars have kept in view the difference between his mosque and other places, so much so that the disliking of saying “زرت قبر النبی” (“I visited the grave of the Prophet”) is reported from Imam Malik (may Allah have mercy on him). This is because the sole purpose of visiting a graveyard is that a person supplicates for the people of the graves and offers greetings of peace, and this duty is fulfilled by sending blessings and peace upon the Messenger of Allah ﷺ while praying, when entering and leaving the mosque, and at the time of the adhan and supplication. So it is sunnah and recommended for everyone to send blessings and peace upon the Messenger of Allah ﷺ when supplicating, because he ﷺ is dearer to the believers than their own selves. Therefore every person praying says blessings and peace upon the Messenger of Allah ﷺ before offering greetings of peace upon himself and all the righteous servants:
السَّلَامُ عَلَيْكَ أَيُّهَا النَّبِيُّ وَرَحْمَةُ اللَّهِ وَبَرَكَاتُهُ، السَّلَامُ عَلَيْنَا وَعَلَى عِبَادِ اللَّهِ الصَّالِحِينَ
“Peace be upon you, O Prophet, and the mercy of Allah and His blessings. Peace be upon us and upon the righteous servants of Allah.”
Apart from the honoured grave, there is no mosque near any grave for whose visit it is recommended to pack up and set out on a journey. However, visiting the honoured grave is valid, just as going to an ordinary graveyard is permissible.