An electrochemical method was developed to fabricate nanoporous gold electrodes by alloying and dealloying Au–Zn alloy in ZnCl2–urea deep eutectic solvent.