There is an increasing demand for rapid, sensitive, and low cost analytical methods to routinely screen antibiotic residues in food products. Conventional detection of antibiotics involves sample preparation by liquid-liquid or solid-phase extraction, followed by analysis using liquid chromatography-mass spectrometry (LC-MS), capillary electrophoresis (CE), or gas chromatography (GC). The process is labor-intensive, time-consuming, and expensive. In this study, we developed a new analytical method that combines magnetic molecularly imprinted polymer (MMIP)-based sample preparation with surface-enhanced Raman spectroscopy (SERS)-based detection for quantitative analysis of cloxacillin in pig serum. MMIP microspheres were synthesized using a core-shell technique. The large loading capacity and high selectivity of the MMIP microspheres enabled efficient extraction of cloxacillin, while the magnetically susceptible characteristics greatly simplified sample handling procedures. Low cost and robust SERS substrates consisting of vertical gold capped silicon nanopillars were fabricated and employed for the detection of cloxacillin. Quantitative SERS was achieved by normalizing signal intensities using an internal standard. By coherently combining MMIP extraction and silicon nanopillar-based SERS biosensor, good sensitivity toward cloxacillin was achieved. The detection limit was 7.8 pmol. Cloxacillin recoveries from spiked pig plasma samples were found to be more than 80%.