so visit them, for they remind you of the Hereafter.” (1)
As for his practice, it is authentically reported that he, may Allah bless him and grant him peace, would go out to al-Baqi' cemetery and greet its inhabitants with peace. (2)
The Prophet, may Allah bless him and grant him peace, had initially forbidden visiting graves because people had only recently left behind disbelief and polytheism, and he feared that this might become a means leading to associating partners with Allah. But once faith had become firmly established in their hearts, he permitted them to do so. He, may Allah bless him and grant him peace, said to them: “I had forbidden you from visiting graves, so visit them.” (3) The Messenger, may Allah bless him and grant him peace, then explained the wisdom behind this, saying: “For they remind you of the Hereafter.” (4) That is, they remind you through their very condition, not by speaking.
For when a person comes to the graves and remembers that the one now lying in the grave was, only yesterday, with him—eating as he eats, drinking as he drinks, enjoying the pleasures of this world as he enjoys them, and able to perform righteous deeds just as he himself is now able to do—then remembering this must affect his heart. He will prepare for the day to which his companion of yesterday has now come. He will remember that his own final destination is this grave and that he may enter it soon; thus he remembers, takes heed, and acts accordingly.
For this reason, the visitor should consciously reflect upon this meaning, rather than merely upon supplicating for those in the graves. For this is the meaning by which the Prophet, may Allah bless him and grant him peace, explained the command to visit them, when he said: “For they remind you of the Hereafter.”
Except for Women ..........
His statement, “except for women”: it is not a sunnah for women, and there are five views on this issue: