Excitonic effects caused by Coulomb interactions between electrons and holes play subtle and significant roles on photocatalysis, yet have been long ignored. Herein, porphyrinic covalent organic frameworks (COFs, specifically DhaTph-M), in the absence or presence of different metals in porphyrin centers, have been shown as ideal models to regulate excitonic effects. Remarkably, the incorporation of Zn2+ in the COF facilitates the conversion of singlet to triplet excitons, whereas the Ni2+ introduction promotes the dissociation of excitons to hot carriers under photoexcitation. Accordingly, the discriminative excitonic behavior of DhaTph-Zn and DhaTph-Ni enables the activation of O2 to 1O2 and O2•-, respectively, under visible light irradiation, resulting in distinctly different activity and selectivity in photocatalytic terpinene oxidation. Benefiting from these results, DhaTph-Ni exhibits excellent photocatalytic activity in O2•--engaged hydroxylation of boronic acid, while DhaTph-Zn possesses superior performance in 1O2-mediated selective oxidation of organic sulfides. This work provides in-depth insights into molecular oxygen activation and opens an avenue to the regulation of excitonic effects based on COFs.