The establishment of an efficient method for the analysis of drug residues in animal urine facilitates the real-time monitoring of drugs used in the production of animal-derived food. A modified QuEChERS extraction–liquid chromatography-tandem mass spectrometry (LC–MS/MS) method was established for the determination of 47 banned drug and related chemical residues in livestock urine. The sample was extracted with acetonitrile by converting the acid-base environment. The sample cleanup effects of seven solid phase extraction cartridges and two EMR-Lipid products were compared, and three materials, including graphitized carboxyl multi-walled carbon nanotubes (MWCNTs), PSA, and C18, were selected as QuEChERS adsorbents from 24 materials. All analytes showed good linearity, with correlation coefficients (R2) greater than 0.9936. Low limits of quantification could be obtained, ranging from 0.2 to 5.5 ng/mL. The average recoveries at low, medium, and high spiked levels were in the range of 70.8–114.9 %, with intra-day precision ranging from 2.4 % to 11.2 % and inter-day precision ranging from 4.5 % to 16.1 %. Swine urine and bovine urine samples collected from different farms were effectively analyzed using the developed method, and metronidazole was detected in three swine urine samples.