Nanoporous metal–organic frameworks (MOFs) equipped with light-responsive azobenzene pendant groups present a novel family of smart materials, enabling advanced applications like switchable guest adsorption, membranes with tunable molecular separation factors, and photoswitchable proton conduction. Although it is obvious that for small pore sizes, steric constraints may prohibit azobenzene switching, guidelines for optimizing the MOF architecture to achieve large switching effects have not yet been established. Here, a series of five different photoswitchable azobenzene-containing pillared-layer MOF structures is presented. The switching effect is quantified by the light-induced increase of the uptake amount of butanol as the probe molecule. For fast and reproducible measurements, thin well-defined MOF films, referred to as surface-mounted MOFs (SURMOFs), were used in combination with a quartz crystal microbalance. Although the series comprises similar MOF structures, the magnitude of the switching effect considerably differs, here by a factor of 5. The uptake data show that, rather than the pore size or the number of azobenzene molecules per pore, the density of azobenzene per pore volume is crucial. The finding that a large switching effect is reached for a high density of azobenzene moieties per MOF unit cell provides the basis for further applications of photoswitchable MOFs and SURMOFs.