The irrigation of soils with reclaimed contaminated wastewater or its amendment with sewage sludge contributes to the uptake of pharmaceuticals by vegetables growing in the soil. A multiresidue method has been devised to determine five pharmaceuticals and nine of their main metabolites in leafy and root vegetables. The method employs ultrasound-assisted extraction, clean-up via dispersive solid-phase extraction, and analysis through liquid chromatography–tandem mass spectrometry. Box–Behnken design was used to refine variables such as extraction solvent volume, time of extraction, number of extraction cycles, and the type and amount of d-SPE sorbent. The method achieved linearity (R2) greater than 0.994, precision (relative standard deviation) under 16% for most compounds, and detection limits ranging from 0.007 to 2.25 ng g⁻1 dry weight. This method was applied to a leafy vegetable (lettuce) and to a root vegetable (carrot) sourced from a local market. Parent compounds were detected at higher concentrations than their metabolites, with the exception of carbamazepine-10,11-epoxide.