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.
darimi:3158Ismāʿīl b. Abān > Mūsá b. Muḥammad al-Anṣārī > al-Ḥārith b. Ḥaṣīrah > Zayd b. Wahb > ʿAlī

[Machine] "He said concerning the child of adultery to his mother's guardians: 'Take him, as you inherit him and understand him, and he will not inherit you.'"  

الدارمي:٣١٥٨حَدَّثَنَا إِسْمَاعِيلُ بْنُ أَبَانَ عَنْ مُوسَى بْنِ مُحَمَّدٍ الْأَنْصَارِيِّ قَالَ حَدَّثَنِي الْحَارِثُ بْنُ حَصِيرَةَ عَنْ زَيْدِ بْنِ وَهْبٍ عَنْ عَلِيٍّ

أَنَّهُ قَالَ فِي وَلَدِ الزِّنَا لِأَوْلِيَاءِ أُمِّهِ «خُذُوهُ إْنَكُمْ تَرِثُونَهُ وَتَعْقِلُونَهُ وَلَا يَرِثُكُمْ»