The development of efficient and stable electrocatalysts on the basis of non-precious metals (Co, Fe) is considered as one of the most promising routes to replace expensive and susceptible platinum as the oxygen reduction reaction (ORR) catalyst. Here we report a synthetic strategy for the precursor controlled, template-free preparation of novel mono- (Fe; Co) and bimetallic (Fe/Co) nitrogen-doped porous carbons and their electrocatalytic performance towards the ORR. The precursors are composed of metal–porphyrin based conjugated microporous polymers (M-CMPs with M = Fe; Co; Fe/Co) derived from polymerization of metalloporphyrins by the Suzuki polycondensation reaction, which enables the synthesis of bimetallic polymers with alternating metal–porphyrin units for the preparation of carbon-based catalysts with homogenously distributed CoN4 and FeN4 centres. Subsequent pyrolysis of the networks reveals the key role of pre-morphology and network composition on the active sites. 57Fe-Mössbauer spectroscopy was conducted on iron catalysts (Fe; Fe/Co) to determine the coordination of Fe within the N-doped carbon matrix and the catalytic activity-enhancing shift in electron density. In acidic media the bimetallic catalyst demonstrates a synergetic effect for cobalt and iron active sites, mainly through a 4-electron transfer process, achieving an onset potential of 0.88 V (versus a reversible hydrogen electrode) and a half-wave potential of 0.78 V, which is only 0.06 V less than that of the state-of-the-art Pt/C catalyst