All perfect praise be to Allah the Lord of the Worlds. May His peace and blessings be upon our Prophet Mohammad and upon all his family and companions.
Scholars have agreed that it is permissible to put a marker (a stone or a piece of wood) - with no writings-so that it will be known whose grave it is.
However, if the marker is written on - as is the case in our country-then the following has to be taken into consideration:
1- If there is no need to have writings on the marker, such as verses of Quran, remembrances or phrases of praise and glorification, then this is prohibited by scholarly consensus because 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.
2- If there is a need to write the name of the deceased so that his family and friends will know where his/her grave is, then this is permissible according to the reliable opinion of the Hanafi school of thought, which contradicts the view of the majority of scholars.
Ibn Abdeen (May Allah have mercy on him) said: "There is no sin in writing on the marker since the grave could get covered completely or get stepped on or disrespected in any other form. This is because the prohibition of writing on the grave-if the above Hadith is authentic-is based on practical consensus. According to Al-Hakim, this prohibition is indicated in many authentic narrations, but it isn`t acted upon since there are markers holding the names of the scholars from the east to the west, and this act was done from predecessors to successors. This view is supported by the following narration: " [Narrated Al-Muttalib]
When Uthman ibn Maz'un died, he was brought out on his bier and buried. The Prophet (Peace be upon him) ordered a man to bring him a stone, but he was unable to carry it. The Messenger of Allah (Peace be upon him) got up and going over to it rolled up his sleeves.
The narrator Kathir told that al-Muttalib remarked: The one who told me about the Messenger of Allah (Peace be upon him) said: I still seem to see the whiteness of the forearms of the Messenger of Allah (Peace be upon him) when he rolled up his sleeves. He then carried it and placed it at his head saying: I am marking my brother's grave with it, and I shall bury beside him those of my family who die. {Related by Abu Dawoud}.
Indeed, it seems that the practical consensus on this concession (Writing on the marker of the grave) applies when there is a need to do so. However, if there is no need, then this isn`t permissible. Moreover, even writing verses of the Quran, poetry or phrases of praise and the like is disliked….Thus, it is better to limit the prohibition, stated in the above narration, to writing on the grave for no need." {Raad al-Mohtaar, vol.2/pp.238}. And Allah the Almighty Knows Best.