Abstract In lattice compact gauge theories, we must impose the admissibility condition to have well-defined topological sectors. The admissibility condition, however, usually forbids the presence of magnetic operators, and it is not so trivial if one can study the physics of magnetic objects that depends on the topological term, such as the Witten effect, on the lattice. In this paper, we address this question in the case of 2D compact scalars as it would be one of the simplest examples having analogues of the monopole and the topological term. To define the magnetic operator, we propose the “excision method,” which consists of excising lattice links (or bonds) in an appropriate region containing the magnetic operator and defining the dual lattice in a particular way. The size of the excised region is O(1) in lattice units so that the magnetic operator becomes point-like in the continuum limit. We give the lattice derivation of the ’t Hooft anomalies between the electric and magnetic symmetries and also derive the higher-group-like structure related to the Witten effect.