The Messenger of Allah (ﷺ) forbade these two plants (i.e. garlic and onions), and he said: He who eats them should not come near our mosque. If it is necessary to eat them, make them dead by cooking, that is, onions and garlic.
Hadith Prohibition of Raw Garlic and Onions
The Messenger of Allah (ﷺ) forbade these two plants (i.e. garlic and onions), and he said: He who eats them should not come near our mosque. If it is necessary to eat them, make them dead by cooking, that is, onions and garlic.
Reference: Sunan Abi Dawud 3827 (Book: Foods - Kitab Al-At'imah)
Scholarly Commentary (Tafsir)
This prohibition concerns the consumption of raw garlic and onions due to their strong, offensive odor that may cause discomfort to angels and fellow worshippers in the mosque. The wisdom behind this ruling is to maintain the sanctity and purity of places of worship and to show consideration for others' comfort during congregational prayers.
The phrase "make them dead by cooking" indicates that cooking diminishes the pungent odor, thereby reducing the harm to others. Scholars clarify that this prohibition applies specifically to approaching mosques after consumption, not to the consumption itself, though moderation is always recommended.
Classical jurists from all schools of thought agree that one who consumes these raw should avoid congregational prayers in the mosque until the odor dissipates, but may pray individually. The prohibition emphasizes Islamic etiquette regarding public spaces and consideration for others' senses.
Juridical Rulings (Ahkam)
Status: Makruh Tanzihi (Disliked but not forbidden) to eat raw before mosque attendance
Exception: Permissible when cooked or when one prays alone
Application: Applies to all strong-smelling foods that cause similar discomfort
Purpose: Preservation of mosque sanctity and consideration for worshippers