Abstract The polymeric carbon nitride nanocages (PCNCs) with mesoporous hollow spherical structures and a spherical shell thickness of ca 50 nm have been successfully prepared via an ZnO-template method, in which the ZnO@PCN core-shell structures were fabricated by simple calcination of ZnO nanospheres and deposited melamine, followed by sequential treatment with hydrochloric acid and aqueous ammonia for thorough removal of ZnO templates and residual Zn2+ ions. The as-prepared pure PCNCs were characterized by various physico-chemical techniques combined with the photocatalytic oxidation reaction of rhodamine B in aqueous solution and the photocatalytic hydrogen evolution reaction under visible light irradiation. The photocatalytic evaluation results indicate that the PCNCs catalysts show higher activity for both photocatalytic reactions than the bulk PCN catalysts prepared by conventional calcination method. The characterization results have shown that the enhanced photocatalytic properties of PCNCs catalysts are mainly attributed to their larger specific surface area, more mesoporous in the range of 2–50 nm, lower band gap energy, higher visible light absorbance and more efficient electron-hole separation in the shell of hollow spherical nanocages than those of bulk PCN. Moreover, the PCNCs catalysts with hollow spherical structures exhibit an excellent reusability in both photocatalytic reactions.