A magnetic Fe3O4@SiO2@MIPIL fluorescent sensor for the determination of imidacloprid (IMD) with high sensitivity and specificity was prepared through surface molecular imprinting technology on the surface of Fe3O4@SiO2 by using dialkenyl ionic liquid (C) as a fluorescent polymer monomer. The as-prepared sensor was characterized by thermogravimetric, FT-IR, SEM, TEM, and nitrogen adsorption-desorption analysis. Results showed that IMD rapidly quenched the fluorescence of the sensor within 1 min and had an excellent linear relationship to the fluorescent quenching intensity of the sensor within the range of 1-1000 nM (IMD). The LOD was 0.3 nM (S/N = 3). The sensor had a specific response to IMD and was used to detect IMD in actual spiked environmental water and food samples with satisfactory result.