I heard the Messenger of Allah ﷺ say, "When you pray over the deceased, make your supplication for him sincere."
حدثنا أبو عبيد محمد بن عبيد بن ميمون المديني حدثنا محمد بن سلمة الحراني عن محمد بن إسحق عن محمد بن إبراهيم بن الحارث التيمي عن أبي سلمة بن عبد الرحمن
سمعت رسول الله ﷺ يقول إذا صليتم على الميت فأخلصوا له الدعاء
[Hasan] Reported by Abu Dawud, in "The Book of Funerals," chapter on supplication for the deceased, no. 3199, from the hadith of Muhammad bin Salama, with this wording. Ibn Hibban graded it sahih, and Ibn Ishaq explicitly stated that he heard it directly, according to Ibn Hibban.