In the name of Allah, We praise Him, seek His help and ask for His forgiveness. Whoever Allah guides none can misguide, and whoever He allows to fall astray, none can guide them aright.
Visiting the graves is permissible for the men in Islam, but the Messenger of Allah (saws) invoked the curse of Allah on the women who are frequest visitors to the graves, but there is no harm if a woman occasionally visits the graveyard.
Abdallah ibn Buraidah reported from his father that the Prophet (saws) said: “I had forbidden you to visit graves, but now you may visit them. It will remind you of the Hereafter.” (Muslim, Ahmad, and the Sunan)
(In the beginning at the time of the Prophet (saws), he (saws) prohibited the believers from visitlng the graves because of their proximity to the jahiliyyah (Days of Ignorance). After they had fully entered the fold of Islam, became well pleased with it, and had fully accepted its laws, the Prophet (saws) permitted them to visit graves.)
Abu Hurairah reported that The Prophet (saws) visited his mother’ s grave and cried, and everyone there cried with him. Then the Prophet (saws) said: ‘I sought my Lord’s permission to seek forgiveness for her, but He did not permit me. I then sought permission to visit her grave and He permitted me to do this. You should visit graves, because they will remind you of the reality of death.” (Muslim, Ahmad, and the Sunan)
It is reported in an authentic narration that the Messenger of Allah (saws) said: , “May Allah curse the women who are frequent visitors of the graves.”
Anas reported: “The Prophet(saws) saw a woman crying by the grave of her son, and said to her, ‘Fear Allah, and be patient.’ She replied, ‘What do you care about my tragedy?’ When he went away, someone told her, ‘Indeed, that was the Messenger of Allah (saws).’ The woman felt extremely sorry and she immediately went to the Prophet’s house, where she did not find any guards. She called out: ‘O Messenger of Allah! I did not recognize you.’ The Prophet (saws) said, ‘Verily patience is needed at the time of the first affiction’.” (Bukhari and Muslim) This supports the argument in favor of the permissibility of women visiting graves, for the Prophet, peace be upon him, saw her at the grave and did not show his disapproval of it.
It is not permissible for one to specifically travel to dargahs or any graveyard. If one is in the area or city, then there is no harm if one visits the graveyard. This ruling is based on the narration of the Prophet (saws) who said: “One should not undertake journeys except to three mosques: the Masjid al-Haram (Makkah), the Aqsa mosque (Jerusalem), or this mosque (the Prophets mosque in Medina).”