Ibn Abbās (radiyallāhu ‘anhumā) said: “Allah’s Messenger invoked the curse of Allah upon the women who continually visit the graves and those people who build mosques (places of devotion) over them and place lights over them.” Reported by the authors of the Sunan.
[This hadeeth is authentic due to its collective chains of transmission. For this reason, Al-Albānee declared it to be saheeh in Saheeh Al-Jāmi’ no. 4985. It reported from Ibn ‛Abbās, Abu Hurayrah and Hassān Ibn Thābit (radiyallāhu ‘anhum).]
So based upon this, there is the curse of Allah upon the women who constantly visit the graves ―and due to their plentiful visitations that are polytheistic in nature ―and it is, for this reason, the term in the hadeeth refers to those who women who visit graves excessively. For this reason, many scholars regard this ruling to be specific to those women who make excessive visits to the graves ―visitations that involve polytheism and religious innovations for which there is no proof in the texts.
The fact that this narration is specific to women is an indication that they are more likely to fall prey to superstitious practices and deviated beliefs that are based upon ambiguities and distortions [of texts]. And whoever ponders over the condition of the people knows this.
Some of the scholars state that this prohibition of visiting the graves [for women] was before permission was granted for them to visit. Permission to visit the graves occurs in an authentic hadeeth reported by Muslim wherein the Prophet (salallāhu ‘alaihi wasallam) said: “I used to forbid you from visiting the graves ―but visit them, for indeed they will remind you of the Hereafter.”
[Reported by Muslim, no. 977 from the hadeeth of Buraidah (radiyallāhu ‘anhum) without the addition, “for indeed they will remind you of the Hereafter.” With this wording, it reported by Ahmad in his Musnad, 5/355, no. 23055]
So after this came to the general allowance for men and women. Those scholars who hold that it is allowed for women to visit graves [occasionally] use as a proof the occasion the Prophet (salallāhu ‘alaihi wasallam) passed by a woman who was crying next to a grave.
This hadeeth is reported by Bukhāree (no. 1283) and Muslim (no. 926) from Anas Ibn Mālik (radiyallāhu ‘anhu) who said: The Prophet passed by a woman who was crying next to a grave. So, he said to her: “Have taqwā of Allāh and be patient.” So she responded: “Go away! For you have not been afflicted with my affliction.” She had not recognised him. So it was said to her: “That was the Prophet.” So she went to the door of the Prophet (salallāhu ‘alaihi wasallam) and did not find any guards there. So she said to him: “I did not recognise you.” So he said: “Indeed patience is to be observed at the first strike of calamity.” So here the Prophet (salallāhu ‘alaihi wasallam) did not forbid her from visiting the grave. The scholars also prove that it is allowed for women to visit the graves because ‛Ā’ishah (radiyallāhu ‘anhā) visited the grave of her brother.
[Reported by Abdur-Razzāq in Al-Musannaf, 3/570, no. 6711; authenticated by Al-Albānee in Al-Irwā, no. 775]
The prohibition for women that is reported in the hadeeth does not refer to the visitation that is in accordance to the Sunnah ―rather the prohibition refers to the visitation that involves innovations and polytheistic practices. That is because visiting that is based upon the Sunnah does not entail the person being cursed. The curse is upon the one who does something forbidden, so the hadeeth refers to those women who do that which is forbidden ―it is for this reason the Prophet (salallāhu ‘alaihi wasallam) invoked the curse of Allah upon them.
The proof for this is in his (salallāhu ‘alaihi wasallam) describing them as “those who set up mosques and place lights over them (i.e. the graves)…” Thus no one establishes mosques (places of worship) and lights over graves except the people of superstitious misguided beliefs.
The difference between the innovated visiting and the polytheistic visiting of graves
The innovated visit: This is where the intent and thinking is that the worship and supplication next to a grave is a reason for the reward being multiplied and the worship being accepted.
The polytheistic visit: This is when the deceased is invoked, and needs are sought from him ―and this occurs more often with and women.
As for the visitation that is based upon the Sunnah: This is where one’s intent is to supplicate for the deceased. This is allowed for both men and women in general. ‘Ā’ishah (radiyallāhu ‘anhā) said to the Prophet (salallāhu ‘alaihi wasallam): “How should I address them, O Allah’s Messenger?” He replied: “Say: Peace be upon the inhabitants of this place from the Believers and the Muslims ―and may Allah’s mercy be upon those who have gone ahead from us, and those who will come later on ―and indeed we shall, inshā’ Allāh, join you.” [Reported by Muslim, no. 249]. So this is the correct position in this matter, inshā’ Allāh.
And with Allah lies success and guidance.
(Ref: Imam Ahmad an-Najmi’s (rahimahullāh) explanation of Kitāb at-Tawheed, Chapter 21)