The capture and storage of solar energy using phase change materials (PCMs) are very important for cost-effective energy management. However, their low thermal conductivity and liquid phase leakage pose persistent challenges for effectively harvesting thermal energy with PCMs. Herein, using semicoking wastewater-derived phenolic resin (SWPR) as the carbon source and potassium hydroxide as activator, hierarchical porous carbon (HPC) materials with abundant porous structures were synthesized to confine the PCM. The HPCs generated microporous and mesoporous layered cavities that provided more space as well as capillary adsorption and physical interaction for PCM storage. Shape-stable phase change composites (PCCs) were then fabricated by vacuum impregnation of the HPCs with paraffin wax to address the problems of low thermal conductivity and liquid melt leakage. The PCCs exhibited high energy storage densities of up to 84.07 J g −1 , dimensional stability, excellent thermal cycle stability, and the phase transition enthalpy of around 80.25 J g −1 after 500 heating−cooling cycles. The carbon support increased the thermal conductivity of the optimum PCC by 166% compared to that of pure paraffin wax. This study provides a cost-effective and environmentally friendly method for shape-stable PCMs based on waste-derived porous carbon materials with potential applications in solar−thermal energy storage.