CpG oligonucleotides can stimulate an anticancer immune response. Zhou et al. now develop nanoparticles that can deliver CpG, which promotes cancer cell death after photothermal and photodynamic therapy in vitro and in vivo, concomitant with an immunological response.