A similar hadith is also narrated from Sayyiduna Abu Sa'id Khudri (may Allah be pleased with him).
Brief Explanation
Benefits: … The meaning of these ahadith is that it is not permissible to travel to any place with the intention of seeking blessing (tabarruk), obtaining barakah, or performing prayer with special reward, except for Masjid al-Haram, Masjid al-Nabawi, and Masjid al-Aqsa. Traveling for trade, seeking knowledge, or any other permissible purpose is a different matter.
Shaykh Wali Allah said: The Messenger of Allah sallallahu alayhi wa sallam said: One should not undertake a special journey to any mosque except Masjid al-Haram, Masjid al-Nabawi, and Masjid al-Aqsa. I would like to say that in the era of ignorance (Jahiliyyah), people used to travel to places they considered sacred, visit them, and seek blessing (tabarruk) from them. However, doing so would clearly introduce distortion and corruption into the religion. Therefore, the Prophet sallallahu alayhi wa sallam, through this hadith, closed this door altogether, so that non-ritual symbols (ghayr sha‘a’ir) would not be mixed with the ritual symbols (sha‘a’ir), and so that no cause for worship of other than Allah would arise. In my opinion, the truth is that in this matter, the ruling is the same for graves, places of worship of any wali, Mount Tur, and the like (that traveling to these places with the intention of seeking blessing and special reward is prohibited). (Hujjat Allah al-Balighah)