Artificial photosynthesis of hydrogen peroxide (H2O2) using covalent organic frameworks (COFs) as photocatalysts holds promise for future applications. However, the influence of linkage chemistry on the photoelectrochemical properties and photocatalytic performance of COFs remains a significant challenge. Herein, we designed and synthesized a model system with different linkages, including imine-, amine-, azo-linked COFs, then investigated their photocatalytic activity of overall H2O2 production. The photocatalytic results revealed varying activities for H2O2 synthesis among these COFs, with the azo-linked TTA-Azo-COF (COF synthesized by 4,4',4''-(1,3,5-triazine-2,4,6-triyl)-trianiline and terephthalaldehyde) demonstrating the highest overall H2O2 photosynthesis activity of 2516 μmol g−1 h−1 in an O2 atmosphere without any sacrificial agents, which is 6.72 and 2.85 times higher than that of imine-linked TTA-COF and amine-linked TTA-COF-AR, respectively. Furthermore, TTA-Azo-COF maintained a high photosynthesis H2O2 activity of 2116 μmol g−1 h−1 under an air atmosphere, outperforming most COF-based photocatalytic systems under similar reaction conditions. Further characterizations and density functional theory calculations reveal these various linkages in different COFs result in distinct visible-light absorption, charge transfer capacities and formation energy barriers of key intermediates. This work revealed the significant impact of linkages on COFs and provided comprehensive guidance for the rational design of COFs with tailored linkages to fulfill specific requirements for future applications.