  Context. About 25% -- 50% of white dwarfs are found to be contaminated by
heavy elements, which are believed to originate from external sources such as
planetary materials. Elemental abundances suggest that most of the pollutants
are rocky objects and only a small fraction of white dwarfs bear traces of
volatile accretion.
  Aims. In order to account for the scarcity of volatile pollution, we
investigate the role of the white dwarfs' magnetospheres in shielding the
volatile content of icy objects.
  Methods. We estimated the volatile sublimation of inward-drifting exocomets.
We assume the orbits of the exocomets are circularized by the Alfven wing drag
that is effective for long-period comets.
  Results. Volatile material can sublimate outside the corotation radius and be
shielded by the magnetic field. {The two conditions for this volatile-shielded
mechanism are that the magnetosphere radius must be larger than the corotation
radius and that the volatiles are depleted outside the corotation radius, which
requires a sufficiently slow orbital circularization process.} We applied our
model to nine white dwarfs with known rotational periods, magnetic fields, and
atmosphere compositions. Our volatile-shielded model may explain the excess of
volatile elements such as C and S in the disk relative to the white dwarf
atmosphere in WD2326+049 (G29-38). Nevertheless, given the sensitivity of our
model to the circularization process and material properties of icy objects,
there remains considerable uncertainty in our results.
  Conclusions. Our work suggests a possible explanation for the scarcity of
volatile-accretion signatures among white dwarfs. We also identify a
correlation between the magnetic field strength, the spin period, and the
composition of pollutants in white dwarf atmospheres.
