"قَدْ كُنتُ نَهيتكُمْ عن زِيارة القُبورِ- فَقَدْ أُذنَ لمحمَّدٍ فِي زِيارةِ قَبْرِ أُمِّهِ- فزُوروها فإِنَّهَا تُذَكِّرُكُم الآخِرةَ".
It is a Sunnah to visit graves as they remind one of death
The Messenger of Allah ﷺ as saying: I forbade you to visit graves, but you may now visit them, for in visiting them there is a reminder (of death).
قَالَ رَسُولُ اللَّهِ ﷺ نَهَيْتُكُمْ عَنْ زِيَارَةِ الْقُبُورِ فَزُورُوهَا فَإِنَّ فِي زِيَارَتِهَا تَذْكِرَةً
It was narrated from Ibn Mas’ud that the Messenger of Allah ﷺ said, “I used to forbid you to visit the graves, but now visit them, for they will draw your attention away from this world and remind you of the Hereafter.”
أَنَّ رَسُولَ اللَّهِ ﷺ قَالَ كُنْتُ نَهَيْتُكُمْ عَنْ زِيَارَةِ الْقُبُورِ فَزُورُوا الْقُبُورَ فَإِنَّهَا تُزَهِّدُ فِي الدُّنْيَا وَتُذَكِّرُ الآخِرَةَ
The Messenger of Allah ﷺ as saying: I forbade you to visit graves, but you may now visit them, for in visiting them there is a reminder (of death). (Using translation from Abū Dāʾūd 3235)
قَالَ رَسُولُ اللَّهِ ﷺ «نَهَيْتُكُمْ عَنْ زِيَارَةِ الْقُبُورِ فَزُورُوهَا فَإِنَّهَا تُذَكِّرُكُمُ الْمَوْتُ»
"نَهَيتُكُمْ عَنْ زِيَارَةِ الْقُبُورِ فَزُورُوهَا، فَإنَّهَا تُذَكِّرُكُمُ الْمَوْتَ".
"كُنْتُ نَهَيتُكُمْ عَنْ زيَارَةِ القُبُورِ فَزُورُوا القُبورَ، فَإِنهَا تُزَهِّدُ لي الدنْيَا، وَتُذَكِّر الآخِرَةَ".