In the present work, the sol-gel method was used to synthesize the Zn1-x-yErxCoyO system with different cations concentrations. The effect of dopant cations on the morphological, structural, and optical properties of particles, as well as their photocatalytic degradation of Yellow Eosin (YE) dye under UV irradiation, was investigated. X-ray diffraction (XRD) indicated excellent crystallinity of Wurtzite-like ZnO structures. Fourier Transform Infrared Spectroscopy showed characteristic absorption bands of ZnO. In addition, the dopant with different ions caused a decrease in the band gap energy compared to pure ZnO (3.16 eV), which is likely due to the defect levels formation. At higher Er3+ concentrations, the materials showed a slight reduction in the band gap (3.10 eV). However, for the samples with the highest Co2+ concentration, a lower band gap (3.0 eV) was observed, indicating that higher Co2+ concentrations favor the ZnO lattice distortion. In photocatalytic tests, the degradation rate of YE (∼48.7 %) was achieved using the ZEC23 sample (2 % of Er3+ and 3 % of Co2+), which is associated with the greater surface area found for this material. In a scavenger study, there was an increase in the rate of dye degradation (66.81 %) using ZEC23 when using an electron (e–) inhibitor reagent. In the presence of MetOH, a degradation rate of 44.0 % was observed, suggesting that the •OH radicals play a key role in the YE degradation.