Photoimmunotherapy has emerged as a promising strategy for cancer therapy due to its increased therapeutic effect, ability to reverse drug resistance, and enhanced immune activation. But there is still a lack of effective nanomaterial-based photothermal therapy (PTT) or photodynamic therapy (PDT) agents in photoimmunotherapy. In this study, photosensitizer hematoporphyrin-modified G5 PAMAM (G5-HP) nanomaterials are synthesized, which exhibit excellent photothermal conversion capability and photodynamic effects under 660 nm irradiation, effectively inducing tumor cell ablation and immunogenic cell death (ICD). Besides, ICD induced by G5-HP can generate tumor-associated antigens, thereby enhancing dendritic cell (DC) maturation and subsequent T cell activation. In addition, G5-HP polymers can bind to Toll-like receptor (TLR) agonists CpG-ODN through electrostatic interaction, forming stable G5-HP/CpG nanoparticles. The incorporation of CpG-ODN as an immunoadjuvant further amplified DC maturation, synergizing with phototherapy to strengthen antitumor immunity. Notably, in vivo studies confirmed that G5-HP/CpG nanoparticles significantly suppressed colorectal tumor growth under laser irradiation, while maintaining excellent biocompatibility. Taken together, the synthesized G5-HP polymers perform excellent PTT and PDT efficacy, and the formed G5-HP/CpG nanoparticles effectively integrate phototherapy with DC-mediated immunotherapy. This study offers a promising strategy for colorectal cancer treatment, leveraging the synergistic effects of phototherapy and immunotherapy to achieve superior antitumor outcomes.