Metal–organic frameworks (MOFs) are regarded as advanced materials for oxygen evolution reactions (OER) because of their large specific surface area, adjustable pore size and abundant intrinsic molecular/atomic metal active sites. However, their essential features, such as the organic-ligand-shielded metal centres and low conductivity, make their electrocatalytic potential far from being exploited. These undesired issues can be avoided by designing and constructing MOF nanoarrays (MOF NAs) on self-supporting and conductive substrates such as the carbon cloth. Transforming appropriate solid material nanoarrays into MOF NAs provides a possibility to unlock the bottleneck. Herein, we have successfully developed a general approach for the morphological and electronic modulation of Co/Ni-MOF-74 NAs with wall-like Co/Ni(OH)2 NAs as the self-sacrificing template. The wall- or spindle-like morphology of MOF-74 NAs was modulated by changing the dosage of ligand. As a result, Co/Ni-MOF-74 NAs displayed superior activity and stability to those of Co/Ni-MOF-74 prepared without the template. The Co0.5Ni0.5-MOF-74 NAs delivered a low overpotential of 244 mV at a current density of 10 mA cm−2 due to the high proportion of active high-valence Co(III) and Ni(III). The proposed strategy can be extended to obtain brick-like Ni-BDC NAs and needle-like Ni BTC MOF NAs on carbon cloth.