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.
Living in Mecca and Medina is not beneficial without obedience to the Messenger
Performing I'tikaf at the honored grave or any other grave, or sitting near it, has not been deemed recommended by any scholar, companion, or the Prophet Muhammad ﷺ himself, nor should one intend to build a house near any grave. In Madinah Tayyibah, the person who obeys Allah Almighty and His Messenger has superiority, like those who were commanded to migrate. At that time, undoubtedly, residing in Madinah Munawwarah was better than Makkah Mukarramah; indeed, living in Madinah Munawwarah was obligatory. However, after the conquest of Makkah, the Prophet ﷺ said:
”لا هجرة بعد الفتح ولكن جهاد ونية“
After the conquest of Makkah, there is no migration, but there is jihad and intention.
Reference: Sahih Bukhari, Book of Jihad: Chapter on the Virtue of Jihad and Travel (Hadith: 2783) Sahih Muslim, Book of Leadership: Chapter on Allegiance after the Conquest to Islam (Hadith: 83/1864, 1353)
After the conquest of Makkah, if a person went from Makkah Mukarramah or any other place to Madinah Munawwarah with the intention of residing there, the Prophet ﷺ would order him to return.
Sayyiduna Umar Farooq رضي الله عنه, on the occasion of Hajj, would order people to leave Makkah so that the people of Makkah would not be troubled or feel constrained.
The Messenger of Allah ﷺ used to send the companions رضي الله عنهم to other areas during migration, entrusting them with responsibilities such as governance.
When Madinah Munawwarah was the abode of migration, even then, obeying the Messenger and going away from Madinah was considered the best. So what would be the ruling after migration? This applies to the person who benefits from obeying Allah and His Messenger, and for the one who is not such, proximity to the honored grave will not be beneficial. As per the narration in Sahih Bukhari, the Messenger of Allah ﷺ said:
”يا فاطمة بنت محمد لا أغني عنك من الله شيئا يا صفية عمة رسول الله لا أغني عنك من الله شيئا يا عباس عم رسول الله لا أغني عنك من الله شيئا“
"O my dearest Fatimah! I will not be able to avail you before Allah in any way. O my aunt Safiyyah! I will not be able to avail you before Allah in any way. O my uncle Abbas! I will not be able to avail you before Allah in any way."
Reference: Sahih Bukhari, Book of Tafsir: Surah Ash-Shu'ara (Hadith: 4772) Sahih Muslim, Book of Faith: Chapter on the Saying of Allah (And warn your closest kindred) (Hadith: 204, 206)
On one occasion, the Messenger of Allah ﷺ said:
”إن آل أبى فلان ليسوا لي بأولياء إنما ولي الله وصالح المؤمنين“
"The people of so-and-so tribe are not my awliya (protectors/friends). Allah and the righteous believers are my only awliya and friends."
Reference: Sahih Bukhari, Book of Manners, Chapter on Greeting with Bismillah (Hadith: 5990) Sahih Muslim, Book of Faith: Chapter on Loyalty to the Believers and Disassociation from Others (Hadith: 215)
On another occasion, the Prophet ﷺ said:
”إن أوليائي إلا المتقون حيث كانوا ومن كانوا“
"Wherever the pious are, they are my awliya and friends."
Reference: Musnad Ahmad (235/5) Nahw al-Ma'ani
The command of Allah Almighty is:
إِنَّ اللَّهَ يُدَافِعُ عَنِ الَّذِينَ آمَنُوا
"Indeed, Allah defends those who have believed."
Reference: (22-Al-Hajj:38)
Guidance and Growth in Obedience to Allah and the Messenger
Wherever the believers are, Allah the Generous protects them because of their faith. The Messenger of Allah, peace be upon him, used to say in his sermons:
”من يطع الله ورسوله فقد رشد ومن يعصهما فإنه لا يضر إلا نفسه ولن يضر الله شيئا“
"Whoever obeys Allah and His Messenger is on guidance and growth, and whoever opposes them harms only himself and cannot harm Allah in any way."
Reference: Sunan Abi Dawood, Book of Warfare: Chapter on a man preaching on a bow (Hadith: 197) and its chain is weak as it includes Abu Iyad, an unknown narrator.
The Divine command is:
وَمَن يُطِعِ اللَّهَ وَالرَّسُولَ فَأُولَٰئِكَ مَعَ الَّذِينَ أَنْعَمَ اللَّهُ عَلَيْهِم مِّنَ النَّبِيِّينَ وَالصِّدِّيقِينَ وَالشُّهَدَاءِ وَالصَّالِحِينَ ۚ وَحَسُنَ أُولَٰئِكَ رَفِيقًا ﴿٦٩﴾
"Those who obey Allah and His Messenger will be with those upon whom Allah has bestowed favor, namely the Prophets, the truthful, the martyrs, and the righteous. How excellent are these companions as a company!"
Reference: (4-An-Nisa:69)