Facile fabrication of non-noble electrocatalysis with precisely tunned active centers for oxygen reduction reaction (ORR) and zinc–air batteries (ZABs) are intriguing yet still challenging. Herein, an iron porphyrin-ferrocene conjugated microporous polymer (FeCMP) with isolated Fe centers was used as precursor to fabricate Fe-Nx electrocatalyst. Innovatively, NaSCN as both an active site protectant and a heteroatomic dopant was introduced. Subsequent carbonization at 800℃ for FeCMP mixed with NaSCN resulted in the formation of highly isolated Fe with S- and N-doped porous carbon (FeSNC800), which acts as a bifunctional catalyst with good ORR (E1/2 = 0.88 V) and OER (oxygen evolution reaction, η10 = 0.34 V) performance. The assembled Zinc-air battery possesses 118 mW cm−2 of power density and is stable over 300 cycles. This work highlights the strength of rational designed polymer precursor and heteroatom doping in controlled pyrolysis of platinum group-free electrocatalysts.