حَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ، حَدَّثَنَا الْفَضْلُ بْنُ دُكَيْنٍ، حَدَّثَنَا إِسْرَائِيلُ، عَنْ زَيْدِ بْنِ جُبَيْرٍ، عَنْ أَبِي يَزِيدَ الضِّنِّيِّ، عَنْ مَيْمُونَةَ بِنْتِ سَعْدٍ، - مَوْلاَةِ النَّبِيِّ صلى الله عليه وسلم - أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم سُئِلَ عَنْ وَلَدِ الزِّنَا فَقَالَ ‏"‏ نَعْلاَنِ أُجَاهِدُ فِيهِمَا خَيْرٌ مِنْ أَنْ أُعْتِقَ وَلَدَ الزِّنَا ‏"‏ ‏.‏

It was narrated from Maimunah bint Sa`d, the freed slave woman of the Prophet (PBUH) that : the Messenger of Allah (PBUH) was asked about illegitimate children. He said: “Two sandals in which I wage Jihad are better than freeing an illegitimate child.” Translation Not Available

Book Ref: Sunan Ibn Majah Book 19 Hadith 2531
Web Ref:  Sunan Ibn Majah Vol 3 Book 19 Hadith 2531