Four highly porous covalent organic frameworks (COFs) containing pyrene units were prepared and explored for photocatalytic H2O2 production. The experimental studies are complemented by density functional theory calculations, proving that the pyrene unit is more active for H2O2 production than the bipyridine and (diarylamino)benzene units reported previously. H2O2 decomposition experiments verified that the distribution of pyrene units over a large surface area of COFs plays an important role in catalytic performance. The Py-Py-COF, though contains more pyrene units than other COFs, induces a high H2O2 decomposition due to a dense concentration of pyrene in small proximity over a limited surface area. Therefore, a two-phase reaction system (water-benzyl alcohol) was employed to inhibit H2O2 decomposition. This is the first report on applying pyrene-based COFs in a two-phase system for photocatalytic H2O2 generation.