Visiting the graves at Baqi al-Gharqad cemetery in مدینہ منورہ is a مستحب Sunnah for men. نبی کریم (صلی اللہ علیہ وسلم) used to visit Baqi frequently and would make دعا for those buried there. Many of the greatest companions are buried at Baqi, including Uthman ibn Affan, the wives of نبی کریم (except Khadijah), and many others. Visiting their graves is an act of remembrance and a source of reflection.
Sheikh Ibn Baz stated that the visitor should greet the deceased with the Sunnah greeting: 'Peace be upon you, O people of the abode, from among the believers and the Muslims. May Allah have mercy on those who have gone ahead and those who will follow. We ask Allah for well-being for us and for you.' The visitor then makes دعا for the deceased and reflects on death and the Hereafter. This is the purpose of visiting graves — remembrance of death and دعا for the dead.
Sheikh Ibn Baz also warned against innovations that some people practice at graves: wiping or touching the graves, asking the deceased for intercession or help, placing flowers or cloth on the graves, sitting on the graves, praying toward the graves, or making the visit a formal ritual with specific timings. All of these have no basis in the Sunnah and are prohibited. The visit should be simple — greeting, دعا, and reflection. Women visiting graves is a matter of scholarly discussion, with some scholars permitting it if done properly and without excessive wailing.