A facile template-free in situ self-activation approach for the multiple active components synergistically driven porous carbon was presented via a feasible annealing process. The biomass-derived carbon without additional activation reagents was fabricated using K-rich pomelo peel (PP) as the carbon source, which possesses a high electric conductivity where abundant functional hetero-metal atoms are doped into the carbon framework that playing the role of catalytic graphitization. The K+ that exists within the biomass can induce self-activation during pyrolysis apart from the activating gases during the pyrolysis process. The resulting electrocatalyst of PP-850 (PP was pyrolyzed at 850 °C in an N2 atmosphere) with abundant heteroatoms possesses a higher power conversion efficiency (PCE) of 7.81% as the counter electrode (CE) of dye-sensitized solar cells (DSCs) compared with the CEs calcinated at other temperatures and a similar PCE with Pt counterpart (8.24%) based on the liquid I3 −/I− electrolyte. The better electrocatalytic performance is attributed to the synergistic effect between self-activation and the co-doping of nitrogen, sulfur and phosphorus all together in a carbon matrix. Due to the feasibility of large-scale production, rich heteroatom doping, the PP-derived carbon, which simplifies the procedure and decreases the cost, has a potential application for an alternative electrocatalyst for high-performance photovoltaic devices.