As a general rule kohanim are forbidden from entering a cemetery – this is best exampled by the common rabbinic phrase מי ראה כהן בבית הקברות – what business does a kohen have in a cemetery? this is illustrated in שמות רבה, פרשה ה;
אמר רבי לוי: משל למה הדבר דומה? לכהן שהיה לו עבד שוטה. יצא הכהן חוץ למדינה, הלך העבד לבקש את רבו בבית הקברות. התחיל צווח לבני אדם, שעומדים שם: לא ראיתם בכאן רבי?
אמרו לו: רבך לאו כהן הוא?
אמר להן: הן
אמרו לו: שוטה, מי ראה כהן בבית הקברות!
But sometimes, the kohen does have business in a cemetery such as visiting קברי צדיקים or a loved one – it is in this instance where the שולחן ערוך details the minimal measurement the kohen is to keep away from an actual tombstone .
Any leniency always assumes that there is no enclosure above the kohen and tombstone – if such an enclosure is present the kohen is forbidden from entering that enclosure.
Thus, even though the Ohel itself is open to the sky to eliminate problems of tumas meis in an enclosure the kohen is unable to gain entry to the actual ohel without coming within four tefach’s of the tombstones located on both sides of walkway.
Halacha mandates that a Kohen keep a distance of 12.59 inches (four tefachim) away from a tombstone – provided only if it is fenced in. If there is no fence between the kohen and the tombstone, the kohen is required to maintain a distance of 75.59 inches away from the tombstone. This information can be found in Shulchan Aruch, Yoreh De’ah chap. 371:5.
Sequestered area for kohanim
A proper minhag at many cemeteries is to have a sequestered area at the edge of the cemetery for burial use of kohanim and their family members. This ensures that the kohen family members of the deceased need not transgress the prohibition of defiling themselves to the deceased.