Emerging contaminants such as diclofenac is frequently detected in wastewater treatment plants as they are not specifically designed for the removal of pharmaceutical effluents, which results in poor removal efficiency. Even though photocatalyst has emerged as an excellent alternative, most of the reported photocatalyst portrays fast recombination rate of electron–hole pair and has slow electron mobility. In order to overcome these shortcomings, in the present work, visible light-driven TiO 2/g-C3N4 photocatalyst was synthesized for the photodegradation of diclofenac in aqueous solution. The morphological and optical properties of the photocatalyst were analysed. The photodegradation efficiency was highly improved even at low g-C3N4 loading, indicating the Z-scheme photocatalyst, successfully overcame the electron–hole pair's fast recombination rate. The photodegradation efficiency was represented as a function of all independent variables, using a second-order quadratic model. Response surface methodology (RSM) was used to optimize the degradation process. A maximum degradation efficiency (93.49%) was achieved at the optimum conditions (irradiation time = 90 min, initial solution pH = 5, initial DCF concentration = 5 ppm and g-C3N4 loading = 0.3g/g TiO 2). The as developed photocatalyst is found to be highly stable as it showed a satisfactory recyclability. The process followed a pseudo-first-order reaction. Photodegradation of diclofenac also resulted in ten intermediates as identified using LCMS analysis. © 2021 Elsevier B.V.