• A kind of water compatible magnetic imprinted microspheres (WCMM) is synthesized. • The WCMM adsorbent of dispersive solid-phase extraction can efficiently extract cyanazine and atrazine from environmental water. • The application of dummy template effectively eliminates the problem of template leakage.