Question 596: In terms of ablution, is it then mandatory to do Ziyarat Ghusl or tayammum before entering sacred places or doing salat?
Answer 596: The Fuqaha have mentioned many more Mustahab Ghusls, one of which is Ghusl for the Ziyarat of the Masoomen (A.S.)
The followings are some fatawa of our maraja regarding visiting the holy Shrines of our Infallible Imams (pbuth).
Imam Khomeini (ra): You are supposed to perform Ghusl for the Ziyarat of the holy Shrines of the Imams (as) with the Niyyat of ‘Raja’.
Sayyid Sistani (ha): Performing Ghusl for the Ziyarat of Masoomin (as) has not proved as a Mustahab act, but if one wants to do it, he/she should, as a precaution, perform it with the Niyyat of ‘Raja’, (i.e. with a hope that it might be a desirable act).
Makarem Shirazi (ha), Safi Golpayegani (ha) and the late Bahjat (ra): It is mustahab to perform Ghusl for Ziyarat of Masoomin (as).[1]
Note: If you want to offer the five daily obligatory prayers you have to perform Wudu first. And if there is a barrier preventing water from reaching it you would be allowed to perform Tayammum instead of Wudu or Ghusl.
For further information in this regards, please read the following answers:
Index: Impermissibility of making Wudu after Ghusl, answer 035.
Index: The validity of Ghusl even a barrier finds out after a week, answer 031.
Index: Number of things which invalidate Wudu (ablution), answer 556.
[1] . Risalah Tawzih al-Masael of Nine Marja, edited by Rashedi, Haaj Sheikh Latif, Pgs. 367-368, under issue 645, Payam Edalat Publication, Omidvar Publisher, first edition; The official website of the office of grand Ayatollah Saafi Golpayegani, Q&A section, Fiqhi questions, Mustahab prayer, q 374.