Sayyiduna Abu Hurayrah (may Allah be pleased with him) said that the Messenger of Allah (peace and blessings be upon him) visited the grave of his mother, and he (peace and blessings be upon him) wept and made those around him weep. He (peace and blessings be upon him) said: "I asked my Lord for permission to seek forgiveness for her, but I was not given permission. Then I asked for permission to visit her grave, and it was given to me. So visit the graves, for they certainly remind you of death."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجنائز / 7192
Ibn Buraydah narrates from his father, Sayyiduna Buraydah (may Allah be pleased with him), who said: We set out with the Messenger of Allah (peace and blessings be upon him) on a journey. We halted at a place, and we were about a thousand riders. He (peace and blessings be upon him) stood and prayed two rak'ahs, then he (peace and blessings be upon him) turned towards us with tears flowing from his eyes. Sayyiduna Umar (may Allah be pleased with him) stood up and went to him and said: "May my father and mother be sacrificed for you, O Messenger of Allah! What is the matter with you?" He (peace and blessings be upon him) said: "I asked my Lord for permission to pray for forgiveness for my mother, but I was not given permission, so I wept out of compassion for her from the Fire. I used to forbid you from visiting graves, so now visit them. I forbade you from storing the meat of sacrificial animals beyond three days, so now eat and keep it as long as you wish. And I used to forbid you from drinking in certain vessels; now drink in whatever vessel you wish, but do not drink anything intoxicating."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجنائز / 7193
Zuhayr (may Allah have mercy on him) said: Zubayd bin al-Harith al-Yami (may Allah have mercy on him) narrated this hadith with the same chain, except that he said: "So visit them, and visiting them will increase you in good."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجنائز / 7194
Ahmad bin Yunus said that Mu'arrif bin Wasil narrated the hadith to us, and in it he mentioned briefly the prohibition of visiting graves and also the permission for it.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجنائز / 7195
Sayyiduna Abu Sa'id al-Khudri (may Allah be pleased with him) said that the Messenger of Allah (peace and blessings be upon him) said: "I used to forbid you from visiting graves; so visit them, for in them there is a lesson. I used to forbid you from nabidh; so now make nabidh, but I am not making anything intoxicating lawful. And I used to forbid you from (storing) the meat of sacrificial animals; so eat it and store it."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجنائز / 7196
Sayyiduna Abdullah bin Mas'ud (may Allah be pleased with him) said that the Messenger of Allah (peace and blessings be upon him) said: "I used to forbid you from visiting graves, from the meat of sacrificial animals beyond three days, and from the vessels of nabidh. So visit the graves, for they create detachment from this world and remind of the Hereafter. Eat the meat of sacrificial animals and keep as much of it as you wish; I only forbade you when wealth was scarce, and now Allah has granted abundance to people. Indeed, a vessel does not make anything unlawful, but every intoxicant is unlawful."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجنائز / 7197
Sayyiduna Anas (may Allah be pleased with him) said that the Messenger of Allah (peace and blessings be upon him) forbade, and he mentioned the meat of sacrificial animals, vessels and visiting graves; then he mentioned his permission for all of them. In a hadith it is: "I used to forbid you from visiting graves, then it became clear to me (otherwise); so visit them, for they soften the heart, make the eyes shed tears and remind of the Hereafter. So visit them, but do not wail."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجنائز / 7198