Magnetic solid‐phase extraction (MSPE) employing a metal–organic framework (Fe3O4@UiO‐66‐OH) combined with high‐performance liquid chromatography was developed for the determination of trace diuretics in urine. The structure and properties of Fe3O4@UiO‐66‐OH were investigated using X‐ray diffraction, infrared spectroscopy, scanning electron microscopy and vibrating sample magnetometry. Magnetic solid‐phase extraction conditions, such as adsorbent amount and solution pH, were optimized using response surface methodology. Under the optimal conditions, the method resulted in excellent linearity with a high correlation coefficient (r > 0.99), satisfactory intraday repeatability (1.78–2.99%), low limits of detection (0.08–0.23 ng/ml), and good recoveries in urine samples (between 93.5 and 103%). Fe3O4@UiO‐66‐OH based on MSPE is a novel pretreatment technique for the detection of trace diuretics in urine.