Abdullah bin Abbas reported,

The Messenger of Allah ﷺ said, "There is no recognition of illicit unions in Islam. Whoever engaged in such a union during the period of ignorance, I attach the child to his paternal relatives. But whoever claims a child born out of an illegitimate union, that child neither inherits nor is inherited from."

Ahmad 3416

Daif

حدثنا معتمر عن سلم عن بعض أصحابه عن سعيد بن جبير

عن ابن عباس قال

قال رسول الله ﷺ لا مساعاة في الإسلام من ساعى في الجاهلية فقد ألحقته بعصبته ومن ادعى ولده من غير رشدة فلا يرث ولا يورث

أحمد 3416ضعيف
Contents
Reference
Commentary
Ayat
Collection
Musnad Ahmad
Book
Abdullah bin Abbas bin Abdul-Muttalib
Numbering
Darussalam 3416
Ahmad 3416