In this theoretical investigation we address the effect of defects on thermal excitations in square-lattice dipolar arrays. The samples consist of nanomagnets, whose geometry is adopted from recent experiments [A. Farhan et al.; Nat. Phys. 9 (2013) 375] [13] and allows for thermal activation at room temperature. Various types of defects, all of which may be produced by microstructuring techniques, are introduced into the systems. It turns out that excitations can efficiently be pinned at defects. Furthermore, it is possible to produce ferromagnetic strings of nanomagnets that connect a pair of defects; their lengths are closely related to the distance of the defects and the topology of the magnetic ground-state configuration.