In this work, a novel, rapid, and simple analytical method was proposed for the detection of parabens in milk sample by gas chromatography coupled with mass spectrometry. At the same time, milk sample was pretreated by magnetic solid phase extraction, which detected up to five parabens. A series of important parameters of magnetic solid phase extraction were investigated and optimized, such as pH value of loading buffer, amount of material, adsorption time, ionic strength, eluting solvents, and eluting time. Under the optimized conditions, the corresponding values were more than 0.9991, limits of detection and the limit of quantification were 0.1 and 0.5 ng/mL, respectively. In addition, the recoveries were achieved in range of 95–105%, the liner range were within 0.1–600 ng/mL, and the relative standard deviations were even lower than 5%.