❖ What is the Ruling on Taḥiyyat al-Masjid? ❖
Source: Fatāwā Amunpuri by Shaykh Ghulam Mustafa Zaheer Amunpuri
Question:
What is the ruling on Taḥiyyat al-Masjid (the two units of prayer upon entering the mosque)?
Answer:
Taḥiyyat al-Masjid is recommended (mustaḥabb) by consensus.
❀ Ḥāfiẓ Ibn ʿAbd al-Barr رحمه الله (d. 463H) said:
لا يختلف العلماء أن كل من دخل المسجد فى وقت يجوز فيه التطوع بالصلاة أنه يستحب له أن يركع فيه عند دخوله ركعتين … وليس ذلك بواجب عند أحد.
“The scholars have no difference that whoever enters the mosque at a time when voluntary prayer is permissible, it is recommended for him to perform two rakʿahs upon entering. These are called Taḥiyyat al-Masjid. None of the scholars consider it obligatory.”
(al-Tamhīd: 20/100)
❀ Ḥāfiẓ al-Nawawī رحمه الله (d. 676H) said:
أجمع العلماء على استحباب تحية المسجد.
“The scholars are unanimous on the recommendation of Taḥiyyat al-Masjid.”
(al-Majmūʿ: 4/52)
❀ Ḥāfiẓ Ibn al-Mulaqqin رحمه الله (d. 804H) said:
استحباب تحية المسجد بركعتين، وهى سنة بالإجماع.
“Performing two rakʿahs as Taḥiyyat al-Masjid is recommended; it is a Sunnah by consensus.”
(al-Tawḍīḥ: 5/524)
❀ Ḥāfiẓ Ibn Ḥajar رحمه الله (d. 852H) said:
اتفق أئمة الفتوى على أن الأمر فى ذلك للندب.
“The Imams of fatwa are unanimous that the command regarding this is for recommendation (not obligation).”
(Fatḥ al-Bārī: 1/537)

Taḥiyyat al-Masjid is a recommended Sunnah, agreed upon unanimously by scholars, but it is not obligatory.