Selective removal of petroleum hydrocarbons (PHCs) from soil washing effluents is the key to the surfactant-enhanced soil washing technology. In this study, the diatomite was modified by nonionic surfactant TX-100 and applied in the selective adsorption of PHCs in the soil washing effluents. The modified diatomites were characterized by scanning electron microscopy, Fourier transform infrared spectroscopy, X-ray diffraction, N2 adsorption/desorption and X-ray photoelectron spectroscopy respectively. The adsorption process followed the pseudo-second-order model and the adsorption isotherms indicated that the interaction between PHCs and modified diatomite was monolayer adsorption. The important operating factors such as TX-100 dosage, adsorbent dosage, time and temperature were optimized. With the participation of the low-cost adsorbent TX3-Db with high adsorption capacity, the recovery efficiency of the washing effluents was still up to 78.9% after three cycles. A selective adsorption mechanism, based on steric hindrance and electrostatic repulsion, was proposed to explain the removal of PHCs from washing effluents.