The photoinduced solid-liquid phase transition is a fascinating phenomenon that can be utilized for a range of applications, including debondable adhesives, photolithography, and soft actuators; however, developing polymers with this function is not trivial. In this work, we report an azobenzene (Azo)-containing polymer capable of rapid room-temperature photoliquefaction upon UV irradiation and elucidate the design principles for photoliquefying polymers that harness the photothermal effect. We prepare a series of Azo polymers by coupling diacrylate Azo with dithiol-functionalized flexible spacers of different lengths, such as ethylene glycol (EG), hexa(ethylene glycol) (HEG), and poly(ethylene glycol) (PEG). EG-Azo, with the shortest spacer, has a high melting temperature (Tm) of 78 degrees C due to the strong interactions among the liquid-crystalline Azo molecules. Owing to the high Tm, EG-Azo does not exhibit a photoinduced solid-liquid phase transition, although it has the greatest photothermal effect among the polymers (temperature rise to 50 degrees C). The incorporation of the longer spacers effectively decreases the Tm of the Azo polymers. For example, PEG-Azo possesses a reduced Tm of 40 degrees C, thereby enabling photoliquefaction at room temperature after only 1 min of UV irradiation. PEG-Azo can be reversibly returned to a solid-state within 5 min after the UV light is turned off. This work shows that the length of flexible spacers in azobenzene (Azo)-based polymers is crucial for achieving room-temperature photoliquefaction (i.e., UV light-induced solid-liquid phase transition). By adjusting the length of dithiol-functionalized flexible spacers, the melting temperature (Tm) of Azo polymers can be effectively modulated. Incorporating longer spacers decreases the Tm to a temperature achievable by the photothermal effect of Azo molecules, thus enabling photoliquefaction of Azo polymers at room temperature.