The plastics industry commonly uses dimethyl phthalate(DMP) asa plasticizer. DMP is highly permeable to nature at different pH levelsand temperatures, resulting in the contamination of water, soil, andair. As a result of the high cost, low selectivity, and complicatedpretreatment in the DMP detection process, this paper synthesizedferromagnetic nanomaterials with molecular imprinting, simplifiedthe pretreatment process by ferromagnetic nanomaterials, selectivelyadsorbed DMP using the molecular imprinting method, and finally detectedDMP with the material by SERS. Molecular imprinting polymers (MIPs)have a higher affinity for DMP than NIPs, which are characterizedby fast adsorption rates, strong binding ability, and improved selectiveadsorption ability. Furthermore, the MIPs are reusable, exhibitingonly about a 7% loss in adsorption capacity after seven adsorption-desorptionexperiments. As a consequence of the adsorption of DMP onto Fe3O4@MIPs@Ag, DMP detection was achieved throughSERS characterization, and it was found that the DMP concentrationwas linearly related to the intensity of the corresponding characteristicpeak associated with the DMP, with a detection limit of 4.2 x10(-11) M. According to the tested water samples,the recovery rating ranged from 92.6 to 105%, demonstrating the feasibilityof the proposed method for the detection of DMP in real water samples. We have synthesized a novel materialcombining molecularimprinting technology with SERS for the selective adsorption and detectionof dimethyl phthalate in water.