What do I say when I pass a graveyard?

Yes, there's a short greeting from the sunnah: "As-salamu 'alaykum ahlad-diyar minal-mu'minina wal-muslimin." It means "Peace be upon you, the inhabitants of the city, among the believers, and Muslims," and it continues with a dua for them and for you. You can say it when visiting a Muslim cemetery or simply walking or driving past one.
The greeting the Prophet ﷺ taught
The Prophet ﷺ used to teach his Companions what to say when they went out to the graveyard: "Peace be upon you, the inhabitants of the city, among the believers, and Muslims, and God willing we shall join you. I beg of Allah peace for us and for you" (Sahih Muslim 975).
Aisha reported that he would go to the Baqi' cemetery in Medina at night, greet its people in a similar way and say, "O Allah, grant forgiveness to the inhabitants of Baqi' al-Gharqad" (Sahih Muslim 974). So after the greeting, it's natural to add your own dua: ask Allah to forgive them, have mercy on them and make their graves spacious.
If the Arabic is hard at first, say the meaning in English. You can say it quietly, even from a car or a bus window. There's no need to stop or turn toward the graves.
Why visiting graves is encouraged
The Prophet ﷺ had once forbidden visiting graves, then said, "but you may now visit them" (Sahih Muslim 977). Seeing a cemetery reminds you that this life is short and that you'll meet Allah.
Respecting the graves
- Don't sit or step on graves: the Prophet ﷺ said it would be better to sit on burning coals than to sit on a grave (Sahih Muslim 971).
- Keep it calm: no loud talk, jokes or selfies among the graves.
- Pray to Allah, not to the dead: you pray for them; you don't ask them for help.
- Reading Quran there: scholars differ on reciting at graves, and the popular reports about reading Yasin for the dead are considered weak by many. See Do I have to read Surah Yasin for the dead?
Non-Muslim cemeteries
Many converts have family buried in a church or town cemetery. You may visit their graves to remember them and reflect. The Prophet ﷺ visited his own mother's grave, but said he was not given permission to ask forgiveness for her (Sahih Muslim 976). So the greeting and the dua for forgiveness above are for Muslim graves. See Can I attend my non-Muslim grandma's funeral as a Muslim? and What happens in the grave in Islam?
- Greet Muslim graves with "As-salamu 'alaykum ahlad-diyar..."
- Add a dua for their forgiveness and mercy.
- Don't sit or walk on the graves.
- You may visit non-Muslim relatives' graves to reflect.
People also ask
What does "Allahu Akbar" mean outside of prayer?
Yes, it means the same everywhere: "Allah is greater." Muslims say it when amazed, going up high, on Eid and after prayer.
Read the full answer →What does "Astaghfirullah" mean and how often do I say it?
Yes: Astaghfirullah means "I seek Allah's forgiveness." The Prophet said it 70 to 100 times a day; say it after prayer and after mistakes.
Read the full answer →What dua do I say when it rains?
Yes, say "Allahumma sayyiban nafi'an" when it rains, and "Mutirna bi fadlillahi wa rahmatih" after. Plus a dua for heavy rain.
Read the full answer →What do I say to avoid the evil eye when I like something?
Yes, pray for blessing: say "Barakallahu fik" or "Masha'Allah, la quwwata illa billah" whenever you admire something or someone.
Read the full answer →Can I read my duas from my phone or a paper?
Yes, outside prayer you can read duas from a phone, book or paper. Inside salah, use memorized duas; schools differ on reading.
Read the full answer →