Is it obligatory to enter the mosque through Bab al-Salam and exit through Bab al-Wadaa’?
Question

Is exiting through Bab al-Wadaa’ obligatory for the one who has bid farewell (by doing the farewell tawaf)? Is entering through Bab al-Salam obligatory?.
Praise be to Allah.It is not obligatory for the one who has bid farewell to exit through the gate mentioned, Bab al-Wadaa’; and it is not obligatory for the one who is coming to enter through Bab al-Salam. 
And Allah is the source of strength. May Allah send blessings and peace upon our Prophet Muhammad and his family and companions. End quote. 
Shaykh ‘Abd al-‘Azeez ibn ‘Abd-Allah ibn Baz, Shaykh ‘Abd al-Razzaaq al-‘Afeefi, Shaykh ‘Abd-Allah ibn Qa’ood 
Fatawa al-Lajnah al-Daa’imah,11/299 
See also question no. 34869