The conversion of solar energy into chemical energy can be realized by photocatalytic technology, which is also used for hydrogen peroxide (H2O2) production because of its clean and eco-friendly properties. Here, g-C3N4 (GCN) was coupled with the ZIF-67 derivate (Co3O4@CN) by a thermal treatment to obtain the ZCN-X (X = 5, 10, 15 mg of ZIF-67) composite photocatalyst for H2O2 production for the first time. ZCN-10 showed the optimal photocatalytic H2O2 production efficiency of 531.1 μM (or 2655.3 µmol⋅g-1⋅h-1) in one hour, which was 3.49 times that of GCN (152.0 μM). ZCN-10 also showed relatively good stability of photocatalytic H2O2 production with a slight decrease after five cycles. The introduction of Co3O4@CN on GCN increases the catalyst's specific surface area, visible light adsorption, surface-adsorbed oxygen content, and separation efficiency of photogenerated carriers, which jointly cause a large increase in photocatalytic H2O2 production. The mechanism for H2O2 production was proved to be a two-step one-electron oxygen reduction reaction (ORR) pathway. This work would shed light on the fabrication of g-C3N4-based photocatalysts with high performance for H2O2 production.