This study aimed to present a selective and effective method for analyzing quinolones (QNs) in food matrix. Herein, a NiFe2O4-based magnetic sodium disulfonate covalent organic framework (NiFe2O4/COF) was prepared using a simple solvent-free grinding method, and was adopted as a selective adsorbent for magnetic solid phase extraction of QNs. Coupled with UHPLC–Q–Orbitrap HRMS, an efficient method for simultaneous detection of 18 kinds of QNs was established. The method exhibited good linearity (0.01–100 ng g−1), high sensitivity (LODs ranging from 0.0011 to 0.0652 ng g−1) and precision (RSDs below 9.5%). Successful extraction of QNs from liver and kidney samples was achieved with satisfactory recoveries ranging from 82.2% to 108.4%. The abundant sulfonate functional groups on NiFe2O4/COF facilitated strong affinity to QNs through electrostatic and hydrogen bonding interactions. The proposed method provides a new idea for the extraction of contaminants with target selectivity.