All perfect praise be to Allah, The Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad is His slave and Messenger.
First of all, we are not aware of any Islamic prohibition that prevents from seeing the grave of the Prophet and that of his two Companions, Abu Bakr As-Siddeeq and ‘Umar ibn al-Khattaab, may Allah be pleased with them.
Some people in the era of the Companions and Taabi’is (the generation that immediately followed that of the Companions) saw the grave of the Prophet . Sufyaan At-Tammaar narrated that he saw the grave of the Prophet and that it was Musannam (i.e. raised at least one hand above the ground. [Al-Bukhaari]
Qaasim ibn Muhammad, may Allah be pleased with him, narrated, “I entered upon ‘Aa’ishah and said, ‘O Mother! Uncover the grave of the Prophet and his two Companions for me,’ so she uncovered three graves which were neither high nor low and which were spread with soft red pebbles in an open space.” [Abu Daawood]
The wisdom behind concealing the grave of the Prophet and not showing it to people is the fear that people would take his grave as a Qiblah (direction of prayer), pray to it, or take it as a mosque at which they would be keen to pray. Indeed, this wisdom is highlighted in Saheeh al-Bukhaari, in which ‘Aa’ishah, may Allah be pleased with her, related that the Prophet in his illness during which he died, said, “Allah cursed the Jews and the Christians as they had taken their places of worship at the graves of their Prophets.” She also said, “Were it not for that, they would have exposed his grave, but I fear that it would be taken as a mosque...” [Al-Bukhaari]
Ibn 'Uthaymeen said:
“Regarding her saying, ‘Were it not for that, they would have exposed his grave,’ expose means to bring him out of his house, because exposing means showing; meaning that were it not for fear that his grave would be taken as a mosque, he would have been taken out and buried in the Al-Baqee’ graveyard, for example, but it was safer for him to be buried in his own house and farther from being taken as a mosque. It is for this reason that his grave was not exposed to the public...”
When the Prophet's Mosque was expanded and the room of ‘Aa’ishah was included in the mosque, the honorable graves were surrounded by a fence and screened from the people so that they would not take it as a Qiblah to pray to, as some people might do out of ignorance.
Imaam An-Nawawi when interpreting Saheeh Muslim, said:
“When the Muslims became great in numbers and the expansions (of the mosque) extended to include the houses of the Mothers of the Believers (the Prophet's wives), among which was the room of ‘Aa’ishah, may Allah be pleased with her, which was the burial place of the Prophet and his two Companions Abu Bakr and ‘Umar, may Allah be pleased with them, they built high circular walls around the graves so that they would not be visible in the mosque lest common people would pray to it and commit the Islamic prohibition. Then they built two walls around the two pillars of the graves in the northern side of the grave and diverted them until the two walls met so that no one could face the grave when praying. It is for this reason that it was said, ‘Were it not for that, they would have uncovered his grave, but it was feared that it would be taken as a mosque,’ in the hadeeth.”
The preservation of the Prophet’s grave was the response from Allah to the supplication of His Prophet who supplicated, “O Allah, do not turn my grave into a worshiped idol; Allah cursed the people who took the graves of their Prophets as places of worship.” [Ahmad - Al-Albaani graded its chain of narrators as saheeh (sound) and Shu’ayb al-Arna’oot graded it as strong]
Ibn Al-Muflih said in At-Tawdheeh, “His saying, ‘O Allah, do not turn my grave into a worshiped idol,’ is an answer from Allah to the supplication of the Prophet ; so praise and gratitude be to Allah.”
For more benefit, please refer to fatwa ">85607.
Allah knows best.