Trapping experiments indicated that the primary active species involved in the photocatalytic degradation of ampicillin were electrons (e⁻) and hydroxyl radicals (•OH). Among the photocatalysts tested, 1 at. % Ce-TiO2 and 1 at. % B-TiO2 emerged as the best performers, likely due to their higher adsorption rates and the advantageous positioning of boron within the Titanium dioxide lattice, which contributed to a decrease in the bandgap.