Abstract The photocatalytic production of hydrogen peroxide (H 2 O 2 ) under alkaline conditions is very important for biomass pretreatment and electronic industry. However, the proton‐deficient nature of alkaline water and the intolerance of COF linkages in strong alkaline conditions lead to insufficient H 2 O 2 production by most COF‐based catalysts. Thus, developing novel COFs containing base‐triggered active sites is an effective strategy to maintain structural rigidity and photocatalytic efficiency. Herein, an indole‐linked COF (CityU‐45) was prepared through the Cadogan–Sundberg post‐synthetic reaction in a nitro‐containing sp 2 ‐carbon COF (CityU‐44). The formation of the indole linkage maintains its crystallinity, reduces the bandgap, and results in the redshift of fluorescent emission. Moreover, CityU‐45 reveals an alkaline‐activated characteristic with a photocatalytic H 2 O 2 rate up to 4854 µmol g −1 h −1 at pH = 13, which is six times higher than that in neutral conditions. This research demonstrated that indole‐linked COFs can be promising catalysts for photocatalytic H 2 O 2 generation under alkaline conditions.