When you enter the Prophet’s Mosque, enter with your right foot first, saying the name of Allah the Most High, and evoking blessings on His Prophet (may His peace and blessings be on him), and ask Allah to open the gates of His mercy for you. The recommended words for entering any mosque, including the Prophet’s Mosque, are:
“A’udhu billahil-adheem wa wajhi hil-kareem wa sultanihil- qadeem mina – shaytani-rajeem. Allahhumma, iftah li abwaba rahmattk.
(I seek refuge in Allah the Al-mighty, and in His noble countenance and in His eternal power, from Satan the Rejected. 0 Allah, open to me the doors of Your mercy.”
Perform two rak’ats of tahiyyat al-masjid (the salat of “greeting of the mosque”) after entering the Mosque, preferably in the Rawdah or otherwise anywhere else in the Mosque.
Then go to the grave of the Prophet (may the peace and blessing of Allah be on him), and standing in front of it and facing it, say in a respectful and hushed voice:
“Assalamu ‘alaika, ayyuhan-nabiyya wa rahmat al lahi wa barakatuhu. ”
(Peace be on you, O Prophet, and the mercy and blessings of Allah),
and call for the blessings of Allah on him.
Then move a little to the right to stand before the grave of Abu Bakr (may Allah be pleased with him). Greet him and supplicate Allah to bestow His mercy and forgiveness on him. Again move a little to the right to stand before the grave of ‘Umar (may Allah be pleased with him), and greet him and make supplication for him.