found it odd that the two men were strangers. They replied, “We are from Taʾif.” He said, “Had you been residents of this city I would have punished you—yes, beaten you until the blows caused you pain—for raising your voices in the Prophet’s Mosque!” This was ʿUmar’s clear disapproval. Yet does his phrase “in the Prophet’s Mosque” signify reverence for that mosque alone, or for every mosque? The evident meaning is that all mosques are to be treated like the Prophet’s Mosque, for the respect is due to a mosque simply because it is a mosque.
Concerning the recitation of poetry in a mosque, some hadiths prohibit it when the verse is frivolous or devoid of benefit. Beneficial poetry, however, is permissible. Ḥassān ibn Thābit used to recite poetry in the Prophet’s Mosque while the Prophet ﷺ listened. On one occasion ʿUmar ibn al-Khattāb overheard him and seemed to object; Ḥassān responded, “I used to recite in this very mosque when someone better than you was present,” meaning the Messenger of Allah ﷺ.
Thus, if poetry contains benefit and serves a wholesome purpose—encouraging obedience, motivating struggle in Allah’s cause when legitimate jihad exists, and the like—there is no harm in reciting it. Poetry that carries no benefit, however, should not be recited in the mosque. Allah knows best.
Note: If someone experiences a wet dream while sleeping in the mosque, performing wudu is sufficient for the moment, but he must perform a full ritual bath before he prays.