Mesoporous silica (MCM-41) nanoparticles modified by azobenzene derivs., capable of storing small mols. and releasing them following light irradn., have been fabricated and characterized. In the presence of the β-cyclodextrin and/or pyrene-modified β-cyclodextrin rings, the β-cyclodextrin and/or pyrene-modified β-cyclodextrin rings will thread onto the azobenzene-contg. stalks and bind to trans-azobenzene units to form the pseudorotaxanes, thus sealing the nanopores and stopping release of the cargo. Upon irradn., the isomerization of trans-to-cis azobenzene units leads to the dissocn. of the β-cyclodextrin and/or pyrene-modified β-cyclodextrin rings from the stalks, thus opening the gates to the nanopores and releasing the cargo.