While catalysis is highly dependent on the electronic structure of the catalyst, the understanding of catalytic performance affected by electron spin regulation remains challenging and rare. Herein, we have developed a facile strategy to the manipulation of the cobalt spin state over covalent organic frameworks (COFs), COF-367-Co, by simply changing the oxidation state of Co centered in the porphyrin. Density functional theory (DFT) calculations together with experimental results confirm that CoII and CoIII are embedded in COF-367 with S = 1/2 and 0 spin ground states, respectively. Remarkably, photocatalytic CO2 reduction results indicate that COF-367-CoIII exhibits favorable activity and significantly enhanced selectivity to HCOOH, accordingly much reduced activity and selectivity to CO and CH4, in sharp contrast to COF-367-CoII. The results highlight that the spin-state transition of cobalt greatly regulates photocatalytic performance. Theoretical calculations further disclose that the presence of CoIII in COF-367-Co is preferable to the formation of HCOOH but detrimental to its further conversion, which clearly accounts for its distinctly different photocatalysis over COF-367-CoII. To the best of our knowledge, this is the first report on regulating photocatalysis by spin state manipulation in COFs.