Domain walls, commonly occurring at the interface of different phases in solid-state materials, have recently been harnessed at the structural scale to enable additional modes of functionality. Here, we combine experimental, numerical, and theoretical tools to investigate the domain walls emerging upon uniaxial compression in a mechanical metamaterial based on the rotating-squares mechanism. We first show that these interfaces can be generated and controlled by carefully arranging a few phase-inducing defects. We establish an analytical model to capture the evolution of the domain walls as a function of the applied deformation. We then employ this model as a guideline to realize interfaces of complex shape. Finally, we show that the engineered domain walls modify the global response of the metamaterial and can be effectively exploited to tune its stiffness as well as to guide the propagation of elastic waves.