Question: Must one wash one’s hands after visiting the graves of righteous individuals or visiting a cemetery? Is the obligation to do so specifically after visiting a cemetery or is one obligated to do so even after participating in a funeral?
Answer: Maran Ha’Shulchan Aruch (Chapter 4) writes: “One who walks between the deceased must wash one’s hands.” This is indeed the age-old custom that after one visits a cemetery, one washes one’s hands with a vessel three times while alternating from hand to hand as one would perform the Netilat Yadayim upon awakening in the morning.
The Reason for This Netilat Yadayim
The source for this law can be found in the commentary of the Mordechi (Berachot, Chapter 194) among other Rishonim. Nevertheless, the reason for this hand-washing is subject to a disagreement. The Ramban writes in his Torat Ha’Adam (Sha’ar Ha’Evel, page 156) that one must wash one’s hands after leaving a cemetery, for water symbolizes man’s formation. He proceeds to discuss this matter lengthily. However, the Meiri (in his Kuntres Bet Yad quoted by the Halacha Berura, Volume 1, page 100) writes that the reason for this is merely for the purpose of cleanliness.
On the other hand, the Maharil writes that the reason for this is because of the Evil Spirit which rests on one’s hands after visiting a cemetery. Other Rishonim write likewise. Indeed, even the Ramban writes at the end of his discussion that he has heard from one of his teachers that the reason for this hand-washing is that it symbolizes purification of the impure.
Based on this, it is quite understandable why it is customary for anyone who enters the four Amot (approximately six feet) of a deceased person to wash his hands (see Magen Avraham, Chapter 4, Subsection 21 where he rules likewise), for the impurity of the dead rests there. Similarly, all those who have accompanied the body of the deceased and were within four Amot of the body customarily wash their hands.
One Who Participates in a Funeral
Nevertheless, if one merely participates in a funeral but did not carry the casket, enter within four Amot of it, or enter a roofed area along with the casket, the Ramban writes in his Torat Ha’Adam (page 155) in the name of a Gaon that one need not wash one’s hands at all.
We must point out that visiting a cemetery needlessly is not the best thing to do. Indeed, Maran Rabbeinu Ovadia Yosef zt”l would advise those close to him not to visit cemeteries at all. He would quote Hagaon Rabbeinu Eliyahu of Vilna as saying that all sorts of suffering and sins come about as a result of visiting cemeteries.
Graves of Righteous Individuals
All of the above applies to regular cemeteries; however, if one visits the grave of a righteous individual and there are no other graves in the vicinity, such as the tomb of Rabbi Shimon bar Yochai, one need not wash one’s hands afterward, for no Evil Spirit rests there (see Yalkut Yosef, Chapter 4, page 412).
Summary: One who visits a cemetery must wash one’s hands upon exiting the cemetery as one would upon waking up in the morning. Similarly, one who was in a house along with the body of a deceased person or one who enters the four Amot (approximately six feet) of a deceased person must wash one’s hands. In the future, the deceased will be resurrected and their impurity will be nullified. May we merit seeing this day, speedily and in our lifetimes, Amen.