Is it permissible to mention Allah (Dhikr) while relieving oneself?
Chapter on Cleaning oneself (Istitabah) and Impurity (Hadath)
Al-Mughni
Book of Purification
Primary text
It is disliked to mention Allah verbally while relieving oneself; this is attributed to Ibn Abbas, Atah, and 'Ikrimah. The Prophet (peace be upon him) did not return greetings during this state, making verbal mention of Allah less appropriate. If one sneezes, one should praise Allah with the heart and not speak.
Supporting text
Ibn Sirin and Al-Nakha'i permit it, stating that Allah is worthy of praise in all states. A narration from Ahmad suggests praising Allah with the tongue is permissible, but the former view is stronger, as even mandatory greetings are not returned.