In the current study, a new magnetic sorbent (Fe3O4@2,6‐diamino‐4‐(3,4‐dihydroxyphenyl) pyridine‐3,5‐dicarbonitrile) was prepared as a new and efficient sorbent to be used in the magnetic solid‐phase extraction method to extract tebuconazole and propiconazole as model compounds. In this regard, effective parameters such as pH of the sample solution, desorption volume, ionic strength, extraction time, desorption time, and amount of the magnetic sorbent were optimized using experimental design. In the optimal condition, the linear dynamic ranges for tebuconazole and propiconazole were between 0.5 and 200.0 µg/L. Also, the limits of detection, limits of quantification, and relative standard deviations were 0.21–0.14 µg/L, 0.49–0.45 µg/L, and 1.3%–4.6%, respectively. The estimated enrichment factors for tebuconazole and propiconazole were 22 and 28, respectively. The absolute recovery (AR%) values for tebuconazole and propiconazole were also 67% and 84%, respectively. Finally, the proposed method was used for determination of tebuconazole and propiconazole in cucumber, tomato, orange, and lemon fruits. The obtained result confirmed that the presented method is capable for the analysis of the selected analytes in complicated matrices. In addition, the ARs% were in the range of 67%–84%. The result proved that the presented method can be an alternative to the extraction process of various pesticides.