Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
suyuti:7282a
Request/Fix translation

  

السيوطي:٧٢٨٢a

"إِنَّ مِمَّا يَلْحَقُ المؤمِنَ مِنْ عَمَلِه وحسَنَاتِهِ بعد موتِه علمًا نَشَرهُ وَوَلدًا صالحًا تركَه ومصحفًا وَرَّثَهُ، أَوْ مسجدًا بناهُ أَو بيتًا لابن السَّبِيلِ بَنَاهُ، أَو نَهْرًا أَجْرَاهُ، أَو صدقةً أَخَرَجَهَا من مالِهِ في صِحَّتِهِ وحياتِهِ، تَلْحَقُهُ من بَعْدِ موتِهِ".  

[هـ] ابن ماجة [هب] البيهقى في شعب الإيمان عن أبى هريرة ؓ (ورواه أَيضًا ابن خزيمة في الزكاة من صحيحه)

See similar narrations below:

Collected by Ibn Mājah
ibnmajah:242Muḥammad b. Yaḥyá > Muḥammad b. Wahbb. ʿAṭiyyah > al-Walīd b. Muslim > Marzūq b. Abū al-Hudhayl > al-Zuhrī > Abū ʿAbdullāh al-Aghar > Abū Hurayrah

"The Messenger of Allah said: 'The rewards of the good deeds that will reach a believer after his death are: Knowledge which he taught and spread; a righteous son whom he leaves behind; a copy of the Qur'an that he leaves as a legacy; a mosque that he built; a house that he built for wayfarers; a canal that he dug; or charity that he gave during his lifetime when he was in good health. These deeds will reach him after his death.'"  

ابن ماجة:٢٤٢حَدَّثَنَا مُحَمَّدُ بْنُ يَحْيَى حَدَّثَنَا مُحَمَّدُ بْنُ وَهْبِ بْنِ عَطِيَّةَ حَدَّثَنَا الْوَلِيدُ بْنُ مُسْلِمٍ حَدَّثَنَا مَرْزُوقُ بْنُ أَبِي الْهُذَيْلِ حَدَّثَنِي الزُّهْرِيُّ حَدَّثَنِي أَبُو عَبْدِ اللَّهِ الأَغَرُّ عَنْ أَبِي هُرَيْرَةَ قَالَ

قَالَ رَسُولُ اللَّهِ ﷺ إِنَّ مِمَّا يَلْحَقُ الْمُؤْمِنَ مِنْ عَمَلِهِ وَحَسَنَاتِهِ بَعْدَ مَوْتِهِ عِلْمًا عَلَّمَهُ وَنَشَرَهُ وَوَلَدًا صَالِحًا تَرَكَهُ وَمُصْحَفًا وَرَّثَهُ أَوْ مَسْجِدًا بَنَاهُ أَوْ بَيْتًا لاِبْنِ السَّبِيلِ بَنَاهُ أَوْ نَهْرًا أَجْرَاهُ أَوْ صَدَقَةً أَخْرَجَهَا مِنْ مَالِهِ فِي صِحَّتِهِ وَحَيَاتِهِ يَلْحَقُهُ مِنْ بَعْدِ مَوْتِهِ