Ag is a promising electrocatalyst for electrochemical reduction of CO2 to CO due to its relatively low cost and high activity. However, it is challenging to achieve high reaction rates while maintaining good selectivity. Here, we used an H2 bubble-templated electrodeposition method in a thiocyanate (SCN)-containing aqueous electrolyte to synthesize a hierarchically porous Ag nanofoam (AgNF) with curved Ag surfaces modified by SCN. This AgNF demonstrates excellent performance for CO2 reduction with a high CO Faradaic efficiency (FECO) of 97%. It can maintain over 90% FECO in a wide potential window (−0.5 to −1.2 VRHE), enabling the maximum CO selective current density of 33 mA cm–2 and the mass activity of 23.5 A gAg–1, which are the highest values among recently reported Ag-based electrocatalysts. Mechanism studies reveal that the catalytic performance of the AgNF correlates with the density of surface SCN ligands, which exhibit excellent electrochemical stability under negative potentials. Density functional theory calculations suggest that SCN ligands promote the formation of COOH* intermediates by modifying the local electron density at the active sites. Further, the synthesis method is applicable to different catalyst substrates. For example, the AgNF grown on a carbon-based gas diffusion film exhibits an ultrahigh mass activity of 52.1 A gAg–1 and maintains its high CO selectivity simultaneously, demonstrating excellent potentials for practical applications.