Charged domain walls in ferroelectrics exhibit a quasi-two-dimensional conduction path coupled to the surrounding polarization. They have been proposed for use as non-volatile memory with non-destructive operation and ultralow energy consumption. Yet the evolution of domain walls during polarization switching makes it challenging to control their location and conductance precisely, a prerequisite for controlled read-write schemes and for integration in scalable memory devices. Here, we explore and reversibly switch the polarization of square BiFeO3 nanoislands in a self-assembled array. Each island confines cross-shaped, charged domain walls in a centre-type domain. Electrostatic and geometric boundary conditions induce two stable domain configurations: centre-convergent and centre-divergent. We switch the polarization deterministically back and forth between these two states, which alters the domain wall conductance by three orders of magnitude, while the position of the domain wall remains static because of its confinement within the BiFeO3 islands.