Visiting مدینہ منورہ and praying in نبی کریم's Mosque is highly مستحب and is one of the most virtuous acts a Muslim can perform. However, it is essential to understand that visiting مدینہ منورہ is not part of the حج rites — it is a separate, independent act of worship. A حاجی may visit مدینہ منورہ before حج, after حج, or even at a completely different time. Both timings are equally valid and there is no scholarly preference for one over the other.
Sheikh Ibn Baz stated that the purpose of visiting مدینہ منورہ is to pray in نبی کریم's Mosque, where one نماز equals one thousand نمازs in other مسجدs (except مسجد الحرام). The حاجی should also send salam upon نبی کریم and his two companions, pray in the Rawdah if possible, and visit Baqi cemetery and the graves of the Uhud martyrs. He emphasized that the trip to مدینہ منورہ is for the sake of praying in the مسجد, not 'visiting the grave' as a حج destination — this is an important theological distinction.
Sheikh Ibn Uthaymeen confirmed that there is no connection between حج and visiting مدینہ منورہ in terms of Islamic law. Some حجاج mistakenly believe that visiting مدینہ منورہ is part of حج or that their حج is incomplete without it. This is incorrect. حج is complete with its own rites performed in مکہ مکرمہ, عرفات, مزدلفہ, and منیٰ. Visiting مدینہ منورہ is a separate recommendation that can be done at any time. He advised حجاج to plan their مدینہ منورہ visit based on practical considerations — flight routes, hotel availability, and group schedule — rather than believing one timing is religiously superior.