We investigate the light-induced magnetization reversal in samples of rare-earth transition metal alloys, where we aim to spatially confine the switched region at the nanoscale, with the help of nano-holes in an Al-mask covering the sample. First of all, an optimum multilayer structure is designed for the optimum absorption of the incident light. Next, using finite difference time domain simulations we investigate light penetration through nano-holes of different diameter. We find that the holes of 200 nm diameter combine an optimum transmittance with a localization better than λ/4. Further, we have manufactured samples with the help of focused ion beam milling of Al-capped TbCoFe layers. Finally, employing magnetization-sensitive X-ray holography techniques, we have investigated the magnetization reversal with extremely high resolution. The results show severe processing effects on the switching characteristics of the magnetic layers.