Ten pharmaceuticals and two consumer products were investigated in four wastewater treatment plants (WWTPs) in Shanghai, China. The concentrations of target compounds in the wastewater influents ranged from below the limit of quantification (LOQ) to 9340 ng/L, with the frequency of detection of 31-100%, and the removal efficiencies were observed to be -82 to 100% in the four WWTPs. Concentrations of most target compounds (i.e. diclofenac, caffeine, metoprolol, sulpiride) in the wastewater influents were around three to eight times higher in urban WWTPs than in suburb ones, probably due to the different population served and lifestyles. Mean concentrations of target compounds in the wastewater influent generally decreased by 5-76% after rainfall due to the dilution of raw sewage by rainwater, which infiltrated into the sewer system. In the WWTPs located in the suburb area, the increased flow of wastewater influent led to a shortened hydraulic retention time (HRT) and decreased removal efficiencies of some compounds. On the contrary, the influence of rainfall was not significant on the removal efficiencies of investigated compounds in urban WWTPs, probably due to the almost unchanged influent flow, good removal performance, or bypass system employed.