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.
muslim:561aMuḥammad b. al-Muthanná And Zuhayr b. Ḥarb > Yaḥyá Wahū al-Qaṭṭān > ʿUbaydullāh > Nāfiʿ > Ibn ʿUmar

The Messenger of Allah ﷺ said during the battle of Khaybar: He who ate of this plant, i. e. garlic, should not come to the mosques. In the narration of Zubair, there is only a mention of" battle" and not of Khaybar.  

مسلم:٥٦١aحَدَّثَنَا مُحَمَّدُ بْنُ الْمُثَنَّى وَزُهَيْرُ بْنُ حَرْبٍ قَالاَ حَدَّثَنَا يَحْيَى وَهُوَ الْقَطَّانُ عَنْ عُبَيْدِ اللَّهِ قَالَ أَخْبَرَنِي نَافِعٌ عَنِ ابْنِ عُمَرَ

أَنَّ رَسُولَ اللَّهِ ﷺ قَالَ فِي غَزْوَةِ خَيْبَرَ مَنْ أَكَلَ مِنْ هَذِهِ الشَّجَرَةِ يَعْنِي الثُّومَ فَلاَ يَأْتِيَنَّ الْمَسَاجِدَ قَالَ زُهَيْرٌ فِي غَزْوَةٍ وَلَمْ يَذْكُرْ خَيْبَرَ  


See similar narrations below:

Collected by Bukhārī, Aḥmad, Dārimī, Ibn Ḥibbān
bukhari:853Musaddad > Yaḥyá > ʿUbaydullāh > Nāfiʿ > Ibn ʿUmar

During the holy battle of Khaibar the Prophet ﷺ said, "Whoever ate from this plant (i.e. garlic) should not enter our mosque."  

البخاري:٨٥٣حَدَّثَنَا مُسَدَّدٌ قَالَ حَدَّثَنَا يَحْيَى عَنْ عُبَيْدِ اللَّهِ قَالَ حَدَّثَنِي نَافِعٌ عَنِ ابْنِ عُمَرَ ؓ

أَنَّ النَّبِيَّ ﷺ قَالَ فِي غَزْوَةِ خَيْبَرَ مَنْ أَكَلَ مِنْ هَذِهِ الشَّجَرَةِ يَعْنِي الثُّومَ فَلاَ يَقْرَبَنَّ مَسْجِدَنَا  

ahmad:4715Yaḥyá > ʿUbaydullāh > Nāfiʿ > Ibn ʿUmar

The Prophet ﷺ said: He who eats from this plant should not come near the mosques. (Using translation from Abū Dāʾūd 3825)   

أحمد:٤٧١٥حَدَّثَنَا يَحْيَى عَنْ عُبَيْدِ اللهِ عَنْ نَافِعٍ عَنِ ابْنِ عُمَرَ

عَنِ النَّبِيِّ ﷺ قَالَ مَنْ أَكَلَ مِنْ هَذِهِ الشَّجَرَةِ فَلَا يَأْتِيَنَّ الْمَسَاجِدَ  

darimi:2097Musaddad > Yaḥyá b. Saʿīd > ʿUbaydullāh > Nāfiʿ > Ibn ʿUmar

[Machine] The Prophet ﷺ said in the Battle of Khaybar, "Whoever eats from this tree, meaning garlic, should not come to the mosques."  

الدارمي:٢٠٩٧حَدَّثَنَا مُسَدَّدٌ حَدَّثَنَا يَحْيَى بْنُ سَعِيدٍ عَنْ عُبَيْدِ اللَّهِ أَخْبَرَنِي نَافِعٌ عَنْ ابْنِ عُمَرَ

أَنَّ النَّبِيَّ ﷺ قَالَ فِي غَزْوَةِ خَيْبَرَ «مَنْ أَكَلَ مِنْ هَذِهِ الشَّجَرَةِ يَعْنِي الثُّومَ فَلَا يَأْتِيَنَّ الْمَسَاجِدَ»  

ذِكْرُ الْبَيَانِ بِأَنَّ حُكْمَ مَسْجِدِ الْمُصْطَفَى ﷺ وَمَسْجِدِ غَيْرِهِ فِيمَا وَصَفْنَا سَوَاءٌ

ibnhibban:2088Abū Yaʿlá And al-Ḥasan b. Sufyān > ʿAbbās b. al-Walīd al-Narsī > Yaḥyá al-Qaṭṭān > ʿUbaydullāh b. ʿUmar > Nāfiʿ > Ibn ʿUmar

“The Messenger of Allah ﷺ said: ‘Whoever eats anything from this plant, let him not come to the mosque.’” (Using translation from Ibn Mājah 1016)   

ابن حبّان:٢٠٨٨أَخْبَرَنَا أَبُو يَعْلَى وَالْحَسَنُ بْنُ سُفْيَانَ قَالَا حَدَّثَنَا عَبَّاسُ بْنُ الْوَلِيدِ النَّرْسِيُّ قَالَ حَدَّثَنَا يَحْيَى الْقَطَّانُ قَالَ حَدَّثَنَا عُبَيْدُ اللَّهِ بْنُ عُمَرَ قَالَ أَخْبَرَنِي نَافِعٌ عَنِ ابْنِ عُمَرَ

أَنَّ رَسُولَ اللَّهِ ﷺ قَالَ «مَنْ أَكَلَ مِنْ هَذِهِ الشَّجَرَةِ فَلَا يَأْتِيَنَّ الْمَسْجِدَ»