Electrochemical nitrate reduction (ENR) is an economical and eco-friendly method for converting industrial wastewater into valuable ammonia under atmospheric conditions. The main challenge lies in designing and developing highly durable ENR electrocatalysts. This study introduces defect-rich mesoporous CuOx nanowires electrocatalyst synthesized using a novel solution-flame (sol-flame) hybrid method to control mesoporosity and introduce surface defects, thereby enhancing the electrochemical nitrate-to-ammonia production performance. We found surface defects (oxygen vacancies and Cu+) and unique mesoporous nanowire structure composed of tightly interconnected nanoparticles. The sol-flame-synthesized CuOx nanowires (sf-CuO NWs) achieved superior ammonia yield rate (0.51 mmol h−1 cm−2), faradaic efficiency (97.3%), and selectivity (86.2%) in 1 M KOH electrolyte (2000 ppm nitrate). This performance surpasses that of non-porous and less-defective CuO NWs and is attributed to the increased surface area and rapid electron transport facilitated by the distinctive morphology and generated defects. Theoretical calculation further suggests oxygen vacancies enhance NO3− adsorption on the sf-CuO NWs’ surface and mitigate the competing hydrogen evolution reaction. This study outlines a strategic design and simple synthesis approach for nanowire electrocatalysts that boost the efficiency of electrochemical nitrate-to-ammonia conversion.