The development of cost-effective and durable oxygen reduction reaction (ORR) catalysts for the electrochemical production of hydrogen peroxide (H2O2) remains a great challenge. Metal sites can tune the reaction kinetics of intermediates during the two-electron (2e−) ORR; however, direct exposure of metal sites to the electrolyte is usually detrimental to the selectivity and stability of H2O2 production. Herein, we developed a simple carbon-added pyrolysis strategy to prepare a composite catalyst with a carbon-layer-wrapped copper oxide. The electrochemical measurements and in situ synchrotron-based characterizations demonstrated that the carbon-wrapping layer blocks the access of Cu sites to electrolytes and transforms those active sites centered on metal sites to carbon sites, suppressing the four-electron ORR side reactions induced by the exposed metal sites; meanwhile, and the inner copper oxide with trace oxygen vacancies induces selective end-adsorption of *O2 and rapid formation of the key reaction intermediate *OOH on carbon sites. Hence, this composite catalyst exhibits notable H2O2 selectivity (98%) and maintains long-term durability for 60 h in an alkaline environment. This work provides some useful insights into the design of highly selective, durable, and customized metal–organic-framework-derived materials to increase the H2O2 yield.