Abstract In this work, the graphitic carbon nitride with −C≡N defects and S‐defects (N 2 −SCN‐4) was constructed. The H 2 O 2 production efficiency of N 2 −SCN‐4 was 1423.3 μmol g −1 h −1 under the visible light ( λ ≥420 nm) irradiation, which was 15.4 times that of pristine g‐C 3 N 4 . The −C≡N groups promote the adsorption of H + and the S‐defects provide the active center for the adsorption and activation of O 2 . Furthermore, the surface morphology, microstructure, and photoelectric chemical properties of samples were investigated by a series of characterizations, and the response range of N 2 −SCN‐4 to visible light increases obviously. Meanwhile, the efficiency of photo‐produced charge separation and the selectivity of H 2 O 2 production were discussed in detail. The experimental and characterization results confirmed that the charge separation efficiency and the selectivity of the 2e − O 2 reduction reaction (ORR) were improved under the synergistic effect of the double defects. This work provides a strategy for improving the photocatalytic performance of photocatalysts.