A class-specific macrolide molecularly imprinted polymer was synthesized by precipitation polymerization using tulathromycin as the template and methacrylic acid as the functional monomer. The polymers revealed different specific adsorption and imprinting factor for macrolides with different spatial arrangement of side chains as well as lactonic ring size. And the molecularly imprinted polymer possessed maximum adsorption capacity (54.1 mg/g) and highest imprinting factor (2.4) toward 15-membered ring azithromycin. On the basis of molecularly imprinted polymer dispersive solid-phase extraction, a rapid, selective, and reproducible method for simultaneous determination of seven macrolide antibiotics residues in pork was established by using liquid chromatography with tandem mass spectrometry. At spiking levels of 5, 10, 25, and 100 μg/kg, average recoveries of seven macrolides ranged from 68.6 to 95.5% with intraday and interday relative standard deviations below 8%. The limits of detection and limits of quantification were 0.2-0.5 and 0.5-2.0 μg/kg, respectively.