The development of polymers with switchable glass transition temperatures (Tg) can address scientific challenges such as the healing of cracks in high-Tg polymers and the processing of hard polymers at room temperature without using plasticizing solvents. Here, we demonstrate that light can switch the Tg of azobenzene-containing polymers (azopolymers) and induce reversible solid-to-liquid transitions of the polymers. The azobenzene groups in the polymers exhibit reversible cis-trans photoisomerization abilities. Trans azopolymers are solids with Tg above room temperature, whereas cis azopolymers are liquids with Tg below room temperature. Because of the photoinduced solid-to-liquid transitions of these polymers, light can reduce the surface roughness of azopolymer films by almost 600%, repeatedly heal cracks in azopolymers, and control the adhesion of azopolymers for transfer printing. The photoswitching of Tg provides a new strategy for designing healable polymers with high Tg and allows for control over the mechanical properties of polymers with high spatiotemporal resolution.