The cleanliness of the place in which prayer is performed is among the conditions for the validity of prayer. Places such as toilets, even if they are physically clean, are not locations that accord with the reverence due to prayer. Prayer is an act in which we present our servitude to our Lord and, in a sense, engage in intimate discourse and supplication before Him. For this reason, performing prayer in such places has been deemed makrūh (disliked).

The makrūh ruling here should be understood as follows: one should not perform prayer in such a place; however, if prayer is nonetheless performed there, the obligation of prayer is discharged.

As for the situation you mentioned, factors such as being in a non-Muslim country, experiencing difficulty in finding a suitable place for prayer, or having limited time may remove the makrūh ruling. In particular, the fact that accessible (disabled) restrooms tend to be more spacious, less frequently used, and therefore generally cleaner may also be considered mitigating factors. Another consideration is that if the toilet fixture is situated in a corner and the remaining area is relatively distinct, this may further lessen the applicability of the ruling associated with toilets.

In summary, praying in such places is contrary to the reverence owed to prayer and should therefore be avoided. However, when no more suitable place is available, prayer may be performed provided that the area used for prayer is clean and that a barrier—such as a prayer mat—is placed on the ground.

And Allah knows best.

Categorized in: