Two almost isoenergetic conformers of 4-methoxybenzaldehyde (p-anisaldehyde), O-trans and O-cis, are nearly equally populated in gas phase at room temperature. The existence of these two conformers of similar energy makes p-anisaldehyde an attractive molecule for conformational investigations, in which the relative populations of the two forms might be subjected to optical control. In the present study, monomers of the compound were trapped from the room-temperature gas phase into cryogenic argon and xenon matrices. The initial relative amount of the two conformers present in the freshly deposited matrices is shifted slightly in favor of the O-trans conformer. The ratio of the two forms could be reversibly varied by irradiating the sample with UV light in different wavelength ranges or by using the temperature variation. Increasing the temperature of the xenon matrix up to ca. 57 K led to conversion of the less stable O-cis form into the O-trans conformer, shifting the O-cis/O-trans ratio to ca. 1:7. A series of UV irradiations with different long-pass cutoff filters was carried out. UV excitation induced transformation of O-cis and O-trans conformers into each other. These transformations were leading to the UV-wavelength-specific photostationary equilibria characterized by the O-cis/O-trans ratios of about 1:2.2, 1:1.4, 1:1.1, and 1:0.89 for lambda > 328, 295, 288, and 234 nm cutoff filters, respectively. The isomerization processes were probed by infrared spectroscopy and supported by quantum chemical calculations. The absorption bands observed in the infrared spectra of p-anisaldehyde isolated in argon and xenon matrices were assigned to the theoretically predicted normal modes.