The effects of visible and infrared light on potassium atoms embedded in a nanoporous glass matrix are investigated. Photodesorption by visible light enhances the atomic mobility and causes the formation of metallic nanoparticles. Two different populations of metastable clusters with absorption bands in the near-infrared and infrared are grown as a consequence of illumination. Atoms can move between the two groups through sequences of adsorption/desorption events at the pore surface. Irradiation with infrared light, instead, does not significantly enhance the atomic diffusion inside the pores. However, it induces relevant modifications of the substrate, thus changing its interaction with the assembled clusters. Consequently, infrared light alters the dynamics of the system, affecting also the evolution of non-resonant nanoparticles populations, even after the illumination sequence. These results provide new insights on the photo-induced modifications of the substrate-adsorbate interaction in nano-sized confined systems.