Travelling for the purpose of visitation is permissible only to three mosques
The Imams of the religion are agreed that it is permissible to set out on a journey only to three mosques: al-Masjid al-Haram, the Prophet’s Mosque, and al-Masjid al-Aqsa. This is because the Messenger of Allah ﷺ said:
”لا تشد الرحال إلا إلى ثلاثة مساجد: المسجد الحرام ومسجدي هذا والمسجد الأقصى“
“Journeys (riḥāl) are to be undertaken only to three mosques: al-Masjid al-Haram, this mosque of mine, and al-Masjid al-Aqsa.”
Reference: Sahih al-Bukhari, Kitab Fadl al-Salah fi Masjid Makkah wa al-Madinah: Bab Fadl al-Salah fi Masjid Makkah wa al-Madinah (Hadith: 1189); Sahih Muslim, Kitab al-Hajj: Bab Fadl al-Masajid al-Thalathah (Hadith: 1397)