An effective strategy of regulating active sites in bifunctional oxygen electrocatalysts is essentially desired, especially in rechargeable metal-air batteries (RZABs). Herein, a highly efficient electrocatalyst of CoFe alloys embedded in pyridinic nitrogen enriched N-doped carbon (CoFe/P-NC) is intelligently constructed by pyrolysis strategy. The high concentration of pyridinic nitrogen in CoFe/P-NC can significantly reprogram the redistribution of electron density of metal active sites, consequently optimizing the oxygen adsorption behavior. As expected, the pyridinic nitrogen guarantees CoFe/P-NC providing the low overpotential of the overall oxygen electrocatalytic process (ΔEORR-OER = 0.73 V vs RHE) and suppresses the benchmark electrocatalysts (Pt/C & RuO2). Assembled rechargeable Zn–air battery using CoFe/P-NC demonstrates a promising peak power density of 172.0 mW·cm−2, a high specific capacity of 805.0 mAh·g−1Zn and an excellent stability. This work proposes an interesting strategy for design of robust oxygen electrocatalysts for energy conversion and storage fields.