Pharmaceutical compounds are chemicals widely applied for the treatment and prevention of human/animal diseases. Wastewater treatment plants (WWTP) are identified as one of their main transfer pathways to aquatic environment since traditional wastewater treatments do not completely remove them. Agricultural irrigation with reclaimed water from WWTP effluents is a growing strategy in areas where water scarcity is a limiting issue. However, the residual presence of these compounds in wastewaters facilitates a new terrestrial route of environmental exposure, increasing the risks of soil pollution and giving rise to dangerous situations for human health and the environment. In this study we have evaluated the effectivity of TiO2 photocatalysis using solar irradiation for the degradation of four contaminants (diclofenac, ibuprofen, ketoprofen and sulfadiazine) in different soil matrices. Influential parameters of photocatalytic process (TiO2 dosage and soil moisture content) were optimized at laboratory scale using UV-LED lamps as light source. Solar remediation trial was performed exposing polluted soils to different treatments (in presence and absence of photocatalyst) during August 2023. After 50 h of solar exposure degradations of these pharmaceuticals reached 97.8–99.5 %, 99.7–100 % and 83.2–97.5 % for soils S1, S2 and S3 respectively. For all compounds, removal followed the order S2 > S1 > S3, in coincidence with the lesser organic matter content of soils. Results suggest that TiO2 photocatalysis under sunlight irradiation could be a useful tool for remediating soils polluted with pharmaceutical residues.