This study presents the findings of an investigation into the characteristics and capabilities of BiVO₄ and Mo-doped BiVO4 coatings for the detection of diclofenac (DCF). In this study, a neutral sodium sulfate electrolyte and an alkaline sodium borate buffer were selected, and a range of potentials were employed to ascertain the impact of diverse conditions on the sensing performance of diclofenac. The introduction of Mo-doping had a profound impact on the photoelectrochemical response of the BiVO4 coating. However, it was observed that Mo-doping resulted in an increase in the adsorption of diclofenac oxidation products on the surface of the photoanode, which in turn led to a negative blocking effect. To evaluate the structural and morphological properties of the coatings, X-ray diffraction analysis (XRD), scanning electron microscopy (SEM), and energy dispersive analysis (EDX) were conducted. The photoelectrochemical properties were evaluated through the use of cyclic voltammetry (CV), electrochemical impedance spectroscopy (EIS) and chronoamperometry (CA). An increase in the photocurrent density of BiVO4 was observed in response to an increase in the concentration of diclofenac within a range of 0.1 to 1 mg L−1 during the sensing experiments. However, at higher concentrations, saturation of diclofenac was observed at the photoelectrode/electrolyte interface. The results of selectivity experiments demonstrated that the nature of the electrolyte has a significant impact on the selectivity of designed photoelectrochemical sensors.