Diclofenac (DCF) exists extensively in sewage treatment plant effluent, and it is one of the most reported environmental pharmaceutical contaminants. In this work, the photocatalytic degradation of DCF by titanium dioxide (TiO2) in pure water under visible light and the influence of humic acids (HA) (as a kind of dissolved organic matter (DOM), phosphate and ferrous ion (Fe2+)) were investigated. The results showed that the lower the pH was, the better the degradation effect of DCF under acidic conditions was. Different concentrations of DOM, phosphate ion, and Fe2+ could inhibit the degradation of DCF, and the higher the concentration was, the stronger the inhibition was. Different concentrations of chloride ions had little effect on the degradation. A slight elimination (8-12.9%) of total organic carbon (TOC) was observed during the mineralization of DCF with and without DOM and inorganic ions, indicating poor mineralization during the process of photocatalytic degradation, and DOM, phosphate, and Fe2+ had little effect on DCF mineralization. Furthermore, hydroxyl radicals, superoxide radicals, and singlet oxygen radicals were present during the photocatalytic degradation of DCF. DOM and inorganic ions could inhibit the intensity of hydroxyl radical and promote superoxide radicals (O2-) and singlet oxygen (1O2) to varying degrees. Finally, the degradation mechanism and main products were analyzed by liquid chromatography-mass spectrometry (LC-MS), and nine possible intermediates were detected. Hydroxylation, dechlorination, cyclization, and oxidation were the main degradation mechanisms. However, DOM, phosphate, and Fe2+ did not affect the type of intermediate products in terms of the mass-to-charge ratio. This paper mainly studied the mechanisms of different influencing factors in simulated environments to provide a theoretical basis for the degradation of DCF in wastewater treatment plants. Graphical abstract.