It was narrated that Jabir said:

“The Messenger of Allah forbade building over graves, making them larger, or plastering over them.” [One of two narrators] Sulaiman bin Musa added: ” Or writing on them.”

[Reported by Muslim and an-Nasa’i. The aforementioned wording is taken from Sunan an-Nasa’i]

Note: Shaykh Albany rahimahullah mentioned one should avoid writing the name of the deceased on the gravestone unless there is no other way to identify the grave except by way of writing the person’s name on it.

Mentioned by

AbdulFattaah Bin Uthman
Abu Fajr