Ali ibn Shammakh said: I was present with Marwan who asked AbuHurayrah: Did you hear how the Messenger of Allah ﷺ used to pray over the dead? He said: Even with the words that you said. (The narrator said: They exchanged hot words between them before that) Abu Hurairah said: O Allah, Thou art its Lord. Thou didst create it, Thou didst guide it to Islam, Thou hast taken its spirit, and Thou knowest best its inner nature and outer aspect. We have come as intercessors, so forgive him. Abu Dawud said: Shu'bah made a mistake in mentioning the name of 'Ali b. Shammakh. He said in his version: 'Uthman b. Shammas. Abu Dawud said: I heard Ahmad b. Ibrahim al-Mawsili say that Ahmad b. Hanbal said: In every meeting which I attended with Hammad b. Zaid he forbade to narrate this traditions from 'Abd al-Warith and Ja'far b. Sulaiman.
The main idea behind this hadith is that we should always remember those who have passed away in our prayers so that Allah may forgive them for any wrongdoings they may have committed during their lifetime on earth. We must also strive to be good intercessors by praying for others even after they are gone so that we can help them attain salvation in the hereafter through our supplications to Allah Almighty .