Cobalt-nitrogen-functionalized materials have been recognized as promising catalysts for the CO2 reduction reaction because of their superior activity. In order to further improve their activity, we proposed an optimization method through coordination engineering in cobalt-nitrogen-functionalized porphyrin and graphene. By considering a series of derived structures with coordinating nitrogen atoms substituted by carbon or oxygen atoms, a clear activity trend is obtained by constructing a volcano-type plot for activity against adsorption energies of *CO. Detailed electronic structure analysis shows that the enhanced catalytic activity is due to the lacking of π bonding in Co-O bonds compared to Co-C or Co-N bonds in cobalt-centered motifs. This difference allows us to predict the catalytic activity by using the vacancy formation energy of the cobalt atom. Our work provides a general guideline for a rational design of efficient catalysts, which may stimulate further study of coordination engineering for other key energy conversion processes.