A novel type of magnetic molecularly imprinted polymer was prepared for the selective enrichment and isolation of chelerythrine from Macleaya cordata (Willd) R. Br. The magnetic molecularly imprinted polymers were prepared using functional Fe O @SiO as a magnetic support, chelerythrine as template, methacrylic acid as functional monomer, and ethylene glycol dimethacrylate as cross-linker. Density functional theory at the B3LYP/6-31G (d, p) level with Gaussian 09 software was applied to calculate the interaction energies of chelerythrine, methacrylic acid and the complexes formed from chelerythrine and methacrylic acid in different ratios. The structural features and morphology of the synthesized polymers were characterized by using Fourier transform infrared spectroscopy, X-ray diffraction, transmission electron microscopy, and vibration sample magnetometry. Adsorption experiments revealed that the magnetic molecularly imprinted polymers possessed rapid kinetics, high selectivity, and a higher binding capacity (7.96 mg/g) to chelerythrine than magnetic molecularly non-imprinted polymers (2.36 mg/g). The adsorption process was in good agreement with the Langmuir adsorption isotherm and pseudo-second-order kinetics models. Furthermore, the magnetic molecularly imprinted polymers were successfully employed as adsorbents for the extraction and enrichment of chelerythrine from Macleaya cordata (Willd) R. Br. The results indicated that the magnetic molecularly imprinted polymers were suitable for the selective adsorption of chelerythrine from complex samples such as natural medical plants.