The utilization of redox mediators (RMs) offers a promising solution to address the issue of excessive charging voltage resulting from the generation of lithium peroxide (Li2O2) at the cathode in lithium‑oxygen (LiO2) batteries. However, the effectiveness of RMs is significantly impeded by a crucial drawback commonly referred to as the “shuttle phenomenon.” This phenomenon involves the RMs not only participating in the decomposition of Li2O2 but also migrating to the anode, where it reacts with the Li metal. Consequently, the RMs experience inevitable degradation, resulting in a severely limited cycling life. To tackle this challenge, we propose a strategy on limiting the 2,2,6,6-tetramethylpiperidin-1-yloxy (TEMPO) worked as RM to the cathodic side by modifying the separator with the g-C3N4 doping with Co (Co-C3N4). Through the adsorption of TEMPO onto the Co-C3N4, the modified separator efficiently captures the TEMPO thus suppresses the shuttle effect. As a result, the Li metal anode is effectively safeguarded, facilitating uninterrupted and prolonged operation of the rechargeable battery. A remarkable cycle life of up to 160 cycles for LiO2 batteries can be realized, thus demonstrating the successful implementation of our strategy.