Abstract We study how the symmetry operator of the axial $U(1)$ non-invertible symmetry acts on the ’t Hooft line operator in the $U(1)$ gauge theory by employing the modified Villain-type lattice formulation. We model the axial anomaly by a compact scalar boson, the “QED axion”. For the gauge invariance, the simple ’t Hooft line operator, which is defined by a line integral of the dual $U(1)$ gauge potential, must be “dressed” by the scalar and $U(1)$ gauge fields. A careful consideration on the basis of the anomalous Ward–Takahashi identity containing the ’t Hooft operator with the dressing factor and a precise definition of the symmetry operator on the lattice shows that the symmetry operator leaves no effect when it sweeps out a ’t Hooft loop operator. This result appears inequivalent with the phenomenon concluded in the continuum theory. In an appendix, we demonstrate that the half-space gauging of the magnetic $\mathbb {Z}_N$ 1-form symmetry, when formulated in an appropriate lattice framework, leads to the same conclusion as above. A similar result is obtained for the axion string operator.