We address the effect of extreme geometry on a non-convex variational problem, motivated by studies on magnetic domain walls trapped by thin necks. The recent analytical results of Kohn and Slastikov (Calc. Var. Partial Differ. Equ. 28:33–57, 2007) revealed a variety of magnetic structures in three-dimensional ferromagnets depending on the size of the constriction. The main purpose of this paper is to study geometrically constrained walls in two dimensions. The analysis turns out to be significantly more challenging and requires the use of different techniques. In particular, the purely variational point of view of Kohn and Slastikov (loc. cit.) cannot be adopted in the present setting and is here replaced by a PDE approach. The existence of local minimizers representing geometrically constrained walls is proven under suitable symmetry assumptions on the domains and an asymptotic characterization of the wall profile is given. The limiting behavior, which depends critically on the scaling of length and height of the neck, turns out to be more com- plex than in the higher-dimensional case and a richer variety of regimes is shown to exist.