It is a great challenge to design highly active, stable and low-cost catalysts for electrochemically splitting water to realize the clean energy generation and renewable energy storage. Herein, a facile one-step dealloying strategy was proposed to synthesize mesoporous CoFe-based oxides and layered double hydroxides (LDHs). Benefitting from the fast mass transfer and more active sites caused by the open mesoporous structure, the CoFe-based materials exhibit excellent electrocatalytic activities and stability towards the oxygen evolution reaction (OER) in an alkaline electrolyte (1 M KOH). The CoFe-LDH catalyst only needs an overpotential of 0.286 V to achieve 10 mA cm-2, and a small Tafel slope of 45 mV dec-1 for the OER. Moreover, an alkaline electrolyzer was constructed with the CoFe-LDH as both the anode and cathode. The electrolyzer delivers a current density of 10 mA cm-2 at a voltage of 1.69 V toward overall water splitting in the 1 M KOH solution.