The advance of efficient electrocatalysts for electrochemical water splitting is very significant for energy conversion systems, but it is hindered by the high overpotential of the oxygen evolution reaction (OER) by four-electron transfer. Herein, we report a variation of transition metal compound based on the Co–Fe Prussian blue analogue precursor. CoP/FeP, Co2N/Fe3N, and CoFe catalysts are synthesized in N2 atmosphere by phosphorization, nitridation, and calcination, respectively. After phosphorization, the synthesized mesoporous CoP/FeP nanocubes contribute to the improvement of the electrocatalyst performance by maintaining the shape of the precursor. The mesoporous structure of the CoP/FeP catalyst enhanced the electrochemically active surface area than other Co2N/Fe3N and CoFe catalysts, resulting in better OER performance with an overpotential of 279 mV at a current density of 10 mA∙cm-2, a Tafel slope of 74 mV∙dec-1, and good stability for 24 h with only 5.64 % degradation in alkaline solution (1.0 M KOH).