In pursuit of finding alternatives to Pt for O2 reduction reaction (ORR), biomass-based catalysts are promising candidates because of their low prices and comprehensive sources that just compensate for the drawbacks of Pt. However, it is difficult to determine unambiguously structure-function correlations of biomass-based catalysts due to their complex structures. Moreover, biomass-based metal-free ORR electrocatalysts often suffer from poor mass transport and pH applicability. Hence, tuning structural variables specifically, improving mass transport within porous domains, and achieving pH-universal catalytic activities are key to optimization of metal-free ORR electrocatalysts derived from biomass. In this study the ‘basic bathing’ method is proposed for precise control over structural variables of nitrogen-doped metal-free ORR electrocatalysts that originate from staple waste biomass—wheat straw. The basic bathing makes use of the fact that KOH can result in a series of physicochemical changes within lignocellulosic biomass and thereby re-proportion pore width distributions of synthesized materials. Under the action of basic bathing, the optimal electrocatalyst having the largest mesopore volume and the equal distribution of nitrogen species is superior in terms of pH-universal ORR electrocatalytic activity when compared to its non-basic-bathing counterparts. The structure-function analyses, benefiting from the specific tuning of mesopores by the basic bathing, demonstrate the linear relations between mesopore volumes and limiting current densities irrespective of pH. Furthermore, the density functional theory (DFT) calculations indicate the synergistic effects of pyridinic, pyrrolic and graphitic nitrogens at a 1:1:1 atomic ratio contribute to the decreased overpotential requirement. Taken together, the reproducible results provide compelling evidence for the importance of mesopores and nitrogen species distributions in enhancing the pH-universal ORR performance. In a broader context, the basic bathing is truly inspirational for niche exploitation of biomass for future energy technologies.