Wastewater analysis has the potential to provide objective and timely data on population drug consumption, but some crucial factors such as pre-analysis drug loss during sample storage and filtration could affect the accuracy and reliability of the method, and these uncertainties have yet to be fully assessed. This study was designed to evaluate analyte stability in wastewater stored under different conditions with the aim of optimizing the sample storage procedures for future studies. It also investigated whether there is significant analyte loss during filtration before sample extraction and storage after that. The studied substances and metabolites were: cotinine, cocaine and its metabolite benzoylecgonine, phenethylamines amphetamine, methamphetamine, 3,4-methylenedioxyamphetamine (MDA), 3,4-methylenedioxymethamphetamine (MDMA), opioids including codeine, methadone, 6-monoacetylmorphine (MAM) and morphine. In most situations, storing samples at 4 °C is sufficient to stabilize analytes for at least 2 weeks, and refrigeration is unnecessary during sample transportation within 3 days. However, additional measures need to be taken if unstable analytes such as cocaine and MAM are to be analyzed. No significant analyte loss was observed in the filtration process or in reconstituted extract stored at 4 °C or −20 °C for 2 weeks. By choosing stable analytes and proper storage conditions, wastewater analysis has the potential to provide accurate data for estimation of community drug use. Copyright © 2012 John Wiley & Sons, Ltd.