Praise be to Allah.
The view that nothing of the sort was narrated at all is not correct, and the view that it is Sunnah is also not correct.
There is no report that the Prophet (peace and blessings of Allaah be upon him) used to stand at the graveside or in the graveyard when the janaazah (body prepared for burial) was brought then exhort the people and remind them as if he were delivering a khutbah on Friday. This is what we have heard of people doing, but this is bid’ah and may lead in the future to things that are more serious. It may lead to the speaker referring of the deceased person who has been brought. For example, if the deceased was an evildoer, the speaker may say, “Look at this man, yesterday he used to play, yesterday he used to mock, yesterday he used to do such and such, but now he is in his grave and being brought to account.” Or he may say concerning a businessman: “Look at So and so, yesterday he was enjoying palaces and cars and servants and so on, and now he is in his grave.”
We think that there should not be a preacher delivering a khutbah at the graveside, because this is not Sunnah. The Prophet (peace and blessings of Allaah be upon him) did not stand after burying the deceased, or when waiting to bury the deceased, and address the people, and we have not heard of anyone doing this among those who came before us, who were closer to the Sunnah than us. Neither have we heard of this from the khulafa’ who came before them. The people at the time of Abu Bakr, ‘Umar, ‘Uthmaan and ‘Ali did not do this, as far as we know, and the best of guidance is the guidance of those who came before, if it is in accordance with the truth. With regard to the exhortation that is like regular talk in a gathering, there is nothing wrong with that, because it is narrated in al-Sunan that the Prophet (peace and blessings of Allaah be upon him) went out to Baqee’ al-Gharqad (the graveyard of Madeenah) where some people were burying one of their number who had died. The deceased had not yet been placed in the lahd (niche in the side of the grave) and they were still digging his grave. He sat down and his companions sat around him, and he started telling them about what happens to a person when he is dying and after he has been buried. He spoke to them in a quiet manner, not in the manner of a khutbah.
It is also narrated in Saheeh al-Bukhaari and elsewhere that the Prophet (peace and blessings of Allaah be upon him) said: “There is no one among you for whom his place in Paradise or in Hell has not been decreed.” They said: “O Messenger of Allaah, shall we not rely on that?” He said: “No; strive hard, for each person will be enabled to do that for which he was created.”
The point is that the kind of exhortation where a man stands and delivers a speech at the burial or afterwards is not Sunnah and is not appropriate for the reasons I have mentioned. As for exhortation that does not take the form of a khutbah or speech, such as when a man sits and his companions sit with him, and he says a few words appropriate to the occasion, this is good and is following the example of the Messenger of Allaah (peace and blessings of Allaah be upon him)