Since the discovery of MCM-41 more than ten years ago, many investigations have explored the suitability of hexagonal mesoporous silicas for potential practical applications. These range from catalysis and optically active materials to polymerization science, separation technology and drug delivery, with recent successes in the fabrication of hybrid mesoporous organosilicas expected to open up further application possibilities. Because the pore voids of this class of materials exhibit relatively narrow pore size distributions in the range of 2-4 nm in diameter, mesoporous silicas can selectively include organic compounds and release them continuously at a later stage. The functionalization of MCM-41 pore voids with photoactive derivatives provides influence over the material's absorption behaviour, but full control over the release process remains difficult. Here we show that the uptake, storage and release of organic molecules in MCM-41 can be regulated through the photocontrolled and reversible intermolecular dimerization of coumarin derivatives attached to the pore outlets. Successful functionalization requires uncalcined MCM-41 still filled with the template molecules that directed the formation of its pores, to ensure that coumarin derivatives attach preferentially to the pore outlets, rather than their inside walls. We find that this feature and the one-dimensional, isolated nature of the individual pores allow for efficient and reversible photocontrol over guest access to the material's interior.