The effect of UV irradiation and UV/chlorine processes on the formation of trichloromethane (CF) and trichloronitromethane (TCNM) from ronidazole (RNZ) disinfection was investigated in this study. Effects of reaction time, pH, and irradiation intensity on disinfection by‐product (DBP) formation were studied during chlorination, UV irradiation, and UV/chlorine processes. The formation potential (FP) of CF and TCNM increased with the increase of chlorination time and reached maximum of 50.6 and 5.0 µg/L, respectively, at pH 8. UV irradiation could increase CF and TCNM formation slightly during post‐chlorination, while the UV/chlorine process could increase the formation potential of TCNM significantly during post‐chlorination with short irradiation time and low UV intensity (e.g., FPTCNM = 459.4 µg/L; UV irradiation: 1.53 mW/cm2 for 20 min). Under UV condition, the formation of CF and TCNM with post‐chlorination increased with the increasing of pH. However, under UV/chlorine condition, the formation of TCNM reached the highest concentration under neutral condition. The DBP formation potential of RNZ during disinfection in the filtered drinking water was also detected. It turned out that disinfection of filtered drinking water with RNZ led to the formation of more DBPs (except the formation of TCNM in the UV/chlorine process) than ultra‐pure water with RNZ only.