The enhanced photocatalytic activity of Ce-TiO2 and Ag-TiO2 can be attributed to their superior adsorption capabilities compared to B-TiO2. The increased adsorption of water on these surfaces generates more hydroxyl radicals, which act as effective oxidizing agents, while also serving as traps for photoexcited holes. In the case of B-TiO2, the presence of boron in interstitial lattice positions creates shallow energy levels below the conduction band, which further reduces recombination rates. Additionally, the presence of Ti3+ species provides trapping sites for photogenerated electrons, contributing to the overall photocatalytic efficiency. The degradation of ampicillin followed pseudo-first-order kinetics, characterized by high rate constants (k values) and R² values, indicating a significant increase in the reaction rate. The degradation pathways identified include decarboxylation, hydroxylation, defluorination, and transformation of the piperazine ring, while the quinolone moiety remained intact. These transformations ultimately lead to the formation of lower molecular weight and less harmful degradation products. The effectiveness of the photocatalytic process was further validated by high-performance liquid chromatography (HPLC) and liquid chromatography-mass spectrometry (LC-MS) data, which showed a marked decrease in the intensity of pollutant peaks, confirming the successful degradation of ampicillin. However, it is noteworthy that the chemical oxygen demand (COD) reduction observed in some photocatalysts was lower than the degradation rates indicated by spectrophotometric measurements. This discrepancy may be attributed to the formation of stable, less harmful organic compounds during the degradation process, as evidenced by the LC-MS analysis. The durability of the photocatalysts was confirmed through three consecutive recycling tests, demonstrating their potential for repeated use without significant loss of activity.