´It was narrated from Abu Sa’eed and ‘Abdullah bin ‘Amr bin ‘As that the Messenger of Allah (ﷺ) said:` “Do not prepare a mount (travel) to visit any mosque except three: the Sacred Mosque, Aqsa Mosque, and this mosque of mine.”
Explanation & Benefits
Maulana Ataullah Sajid
Benefit:
Traveling specifically for the purpose of visiting is only permissible towards these three mosques. Apart from this, it is permissible to travel to any place for any lawful purpose. For example, for the acquisition of knowledge, for jihad, to meet scholars and righteous people, to meet relatives and friends, or for trade and employment. Similarly, if a person is present in Madinah and goes to Masjid Quba, then this is also permissible because this is not considered travel.
Source: Commentary on Sunan Ibn Mājah by Mawlānā ‘Atā’ullāh Sājid, Page: 1410