Shape memory polymers (SMPs) are novel smart materials capable of changing their shape from original to temporary and backward under the effect of various external factors. SMPs can be used to form photonic crystals (PCs), demonstrating a switchable structural color. Herein, we compose a new shape memory photonic crystal (SMPCs) by polymerizing a mixture of ethoxyethoxyethyl acrylate (EOEOEA) and poly (ethylene glycol) diacrylate (PEGDA) monomers in the silica opal templates. The resulting macroporous inverse opal PCs are composed of a rubbery copolymer with a low glass transition temperature. The nanoscale shape memory (SM) effects in these PCs are employed to realize optical memories operational at room temperature. In these memories, photonic stop bands are suppressed by the capillary condensation of water that enables their ‘cold’ programming. The stopbands can be restored to the initial spectral positions by evaporation of liquids characterized by low surface tension such as ethanol, acetone, cyclohexane and n-hexane. The same effect may be achieved by weak contact pressing on the film. During cold programming and recovery, the PC structures switch between disordered and highly ordered states. At the same time, the samples demonstrated robustness, remaining undamaged under a significant mechanical load of up to ∼1 MPa. We successfully memorized complex patterns with use of the developed memories. We foresee applications of SMP-based PCs in switchable responsive sensors, liquid printing, erasable watermarks, signal resonators, information technology, and biomedical applications.