Some people plant things such as Indian fig trees (Opuntia ficus-indica) on graves, based on the claim that the Prophet SAWS (peace and blessings of Allaah be upon him) put that on the graves of two of his companions. What is the ruling on that?.
It is not permissible to plant trees on graves, whether they are Indian fig trees or any other kind, or to sow barley or wheat or anything else on them, because the Messenger did not do that to graves, and neither did the Rightly Guided Caliphs who succeeded him (may Allaah be pleased with them).
With regard to what he did to the two graves when Allaah showed him the torment of their occupants, by planting palm stalks on them, this was something that was for those two graves only, because he did not do that with any other graves. The Muslims have no right to make up new acts of worship that are not prescribed by Allaah, because of the hadeeth mentioned and because Allaah says (interpretation of the meaning):
“Or have they partners with Allaah (false gods) who have instituted for them a religion which Allaah has not ordained?”
Majmoo’ Fataawa al-Shaykh Ibn Baaz, 5/407
See also question no. 48958.