Cobalt phthalocyanine (CoPc) is an appealing electrocatalyst for CO2 reduction. However, its catalytic performance is limited by instability and low conductivity. Herein, theoretical calculations reveal that nitrogen-rich carbon nitride, as a promising Supporting material, can help to tune the electronic structure of CoPc and then enhance its stability and conductivity by inducing electron delocalization of Co-N4 sites for the formation of Co-N5, achieving a superior electrochemical reduction of CO2. Inspired by this prediction, we prepared nitrogen-rich carbon nitride that coordinated with Co-N4 through axial N coordination under 400 ºC, forming an atomically dispersed Co-N5 catalytic site. The synthesized catalyst demonstrates excellent performance in CO2 conversion to CO with >99 % selectivity at a current density of − 5.3 mA cm-2, which can remain for 40 h. These findings provide a strategy for regulating catalytic sites and shed light on expanding the applications of low-cost carbon nitride materials at mild heat-treatment temperatures.