Hadith 1767

She said she asked God’s messenger what she should say, i.e. when visiting graves, and he told her to say, “Peace be upon the inhabitants of the abodes, believers and Muslims, and God show mercy to those of us who go before and those who go later. If God will we shall join you." Muslim transmitted it.

وَعَنْ عَائِشَةَ رَضِيَ اللَّهُ عَنْهَا قَالَتْ: كَيْفَ أَقُولُ يَا رَسُولَ اللَّهِ؟ تَعْنِي فِي زِيَارَةِ الْقُبُورِ قَالَ: " قُولِي: السَّلَامُ عَلَى أَهْلِ الدِّيَارِ مِنَ الْمُؤْمِنِينَ وَالْمُسْلِمِينَ وَيَرْحَمُ اللَّهُ الْمُسْتَقْدِمِينَ مِنَّا وَالْمُسْتَأْخِرِينَ وَإِنَّا إِنْ شَاءَ اللَّهُ بِكُمْ للاحقون ". رَوَاهُ مُسلم

Reference: 5617670
In-book reference: Book 5, Hadith 1767