Controlling the number of molecular switches and their relative positioning within porous materials is critical to their functionality and properties. The proximity of many molecular switches to one another can hinder or completely suppress their response. Herein, a synthetic strategy involving mixed linkers is used to control the distribution of spiropyran-functionalized linkers in a covalent organic framework (COF). The COF contains a spiropyran in each pore which exhibits excellent reversible photoswitching behavior to its merocyanine form in the solid state in response to UV/Vis light. The spiro-COF possesses an urchin-shaped morphology and exhibits a morphological transition to 2D nanosheets and vesicles in solution upon UV light irradiation. The merocyanine-equipped COFs are extremely stable and possess a more ordered structure with enhanced photoluminescence. This approach to modulating structural isomerization in the solid state is used to develop inkless printing media, while the photomediated polarity change is used for water harvesting applications.