The findings of this study underscore the importance of optimizing dopant concentrations to achieve maximum photocatalytic activity while avoiding excessive recombination of charge carriers. The results suggest that the ternary doped TiO2 photocatalysts synthesized in this research can serve as effective materials for the degradation of antibiotics and microbial disinfection, addressing critical environmental challenges posed by antibiotic resistance and water contamination. Future research could explore the scalability of this synthesis method and the application of these photocatalysts in real-world water treatment scenarios, further contributing to sustainable environmental practices. In conclusion, this research has successfully demonstrated the potential of ternary doped titanium dioxide (TiO2) photocatalysts, specifically BxCeyAgzTiO2, for the effective degradation of the antibiotic ampicillin and the disinfection of Escherichia coli under solar light. The synthesis of these photocatalysts using an eco-friendly citrate-EDTA complexing sol-gel method has resulted in materials with enhanced photocatalytic properties compared to their monodoped and codoped counterparts.