Penicillanic acid-imprinted beads prepared in preformed porous silica by an imprinting & etching approach show selectivity towards β-lactams antibiotics. Molecularly imprinted solid phase extraction/micellar electrokinetic chromatography coupled with in-capillary preconcentration resulted in a fast and affordable method for penicillins in milk at MRL levels.