Atomically dispersed transition metal sites have been extensively studied for CO 2 electroreduction reaction (CO 2 RR) to CO due to their robust CO 2 activation ability. However, the strong hybridization between directionally localized d orbits and CO vastly limits CO desorption and thus the activities of atomically dispersed transition metal sites. In contrast, s-block metal sites possess nondirectionally delocalized 3s orbits and hence weak CO adsorption ability, providing a promising way to solve the suffered CO desorption issue. Herein, we constructed atomically dispersed magnesium atoms embedded in graphitic carbon nitride (Mg-C 3 N 4 ) through a facile heat treatment for CO 2 RR. Theoretical calculations show that the CO desorption on Mg sites is easier than that on Fe and Co sites. This theoretical prediction is demonstrated by experimental CO temperature program desorption and in situ attenuated total reflection infrared spectroscopy. As a result, Mg-C 3 N 4 exhibits a high turnover frequency of % 18 000 per hour in H-cell and a large current density of À300 mA cm À2 in flow cell, under a high CO Faradaic efficiency ! 90 % in KHCO 3 electrolyte. This work sheds a new light on s-block metal sites for efficient CO 2 RR to CO.