Utilizing photocatalytic technology to achieve efficient production of H 2 O 2 is a hot topic. Here, we synthesized a photocatalytic material with a strong built-in electric field, namely, Pym-CN, through a hydrothermal-assisted thermal polymerization strategy, which effectively promotes the separation and transfer of photoinduced charge carriers. A pyrimidine ring was successfully introduced into the heptazine structure unit of Pym-CN, which leads to electron aggregation at N�C−N, benefiting for enhancing the strong sorption and activation capabilities of oxygen. Under the condition of visible light wavelength greater than 400 nm (λ > 400 nm), the H 2 O 2 production rate of Pym-CN (2622.5 μmol/L/h) is 7.6 times that of the BCN. A detailed investigation of the reaction mechanism revealed that Pym-CN follows a two-step continuous process of single-electron oxygen reduction reaction (ORR). This work elucidates the application prospects of the donor−acceptor (D−A) structure with a strong built-in electric field in the field of efficient photocatalytic production of H 2 O 2 .