Dye-sensitized solar cells (DSSCs) have great potential as a renewable energy technology assisting combat climate change due to its low cost, adaptability, and sustainability. Oxygen plasma ion doping is a promising strategy to improve the capacity of a low-cost, platinum-free counter-electrodes (CEs) to absorb photons and drive high-performance DSSCs via generating an abundance of active absorption sites. In this instance, novel PAni–ZnO (PZ) composite layers were designed as a CE material and received various in-situ oxygen plasma dosages, including 0, 2, 4, 6, 8, and 10 min, to improve their physiochemical and microstructural feature for the first time, to the best of our knowledge. Physical evaluations of the microstructure, porosity, morphology, contact angle, roughness, electrical, and optical, electrochemical impedance spectroscopy (EIS) features of CEs were conducted in along with an evaluation of J–V variables. Compared to pristine CE substance, the surface nature of the modified hybrids was gradually enhanced as the plasma level rose, reaching an optimum after 8 min (i.e. 0.2 µm for average pore size and average roughness Ra = 7.21 µm). Expanded plasma treatment doses also improved PV cell performance even further: after 4 min at a plasma level, η = 5.41% was obtained, and after 6 min in a oxygen plasma environment, η = 5.81% was obtained. Mixing high energetic plasma ions increased the mobility of charge carriers in PAni composites along with lowered charge carrier recombination through generating an environment that was conducive to charge dissociation. Therefore, longer lifespans and more effective charge transfer inside the photovoltaic cell as a consequence of the increased mobility less resistive losses. In this respect, following 8 min of plasma surface modification of the PZ CE, the optimized efficiency of 6.31% and Jsc of 15.6 mA/cm2 were obtained. The improvement in efficiency equated to a proportion growth of 77% versus a pristine one. This gain was explained by the reality that suffusing a quantity of oxygen plasma free radicals into the PAni system developed continuous channels that enabled the mixture to move electrons more rapidly, hence raising the photovoltaic efficiency. Overall, this study highlights the advantages of regulating heteroatom species and their co-doping, offering a new perspective for the application of heteroatom-doped CE in DSSCs.