Answer: Yes. It is authentically reported that after the burial the Messenger of Allah ﷺ would stand at the grave, supplicate for the deceased, and seek forgiveness for him. He would say to his Companions, “Pray for forgiveness for your brother and ask that he be made steadfast, for he is now being questioned.”
Therefore, once the Muslims have finished burying the deceased, what is prescribed for them is to stand by his grave, ask Allah to forgive him, and implore Allah to grant him steadfastness, for that is the moment when the two angels question him. They should say, “O Allah, forgive him. O Allah, make him steadfast,” and repeat this blessed supplication, for Allah benefits him through it. The prayer of the living for the dead is expected to reach them and profit them. This is the divinely legislated practice: the living supplicate for the dead. What some ignorant people and grave-worshippers do—asking the dead to pray for them, seek forgiveness for them, or intercede for them—is the very opposite of what Allah and His Messenger have prescribed and is a defiance of Allah and His Messenger. What is prescribed is the reverse: that the living pray for the dead and seek forgiveness for them. Allah, the Majestic, says to His Prophet, “And seek forgiveness for your sin and for the believing men and believing women” (Q 47:19).
Whenever the Prophet ﷺ passed by graves, he would face them and say, “Peace be upon you, O inhabitants of the graves. May Allah forgive us and you. You have gone on before us and we shall surely follow you. O Allah, do not deprive us of their reward, do not try us after them, and forgive us and them.”
As for the newly invented practices that people have attached to funerals—customs with no basis in Islamic law—it is obligatory to avoid them, prohibit them, and warn others against them.