In this study, a novel magnetic covalent organic framework (Fe3O4@TAPB-BTT) was successfully synthesized under mild conditions. The prepared magnetic COF exhibited large surface area (876.3 m2 g−1), porous feature as well as sizeable π-conjugated network structure. Due to the above advantages, Fe3O4@TAPB-BTT showed good adsorptive performance for ultraviolet (UV) filters with adsorption capacities ranging from 80.8 to 120.1 mg g−1. Then the adsorbent was applied to magnetic solid phase extraction (MSPE) of UV filters in beverage samples, followed by UHPLC-MS/MS analysis. The established method showed good accuracy, precision, and reproducibility with satisfactory recoveries (76.9–95.6 %), low limits of detection (0.001–0.15 µg/L), and low relative standard deviations (<9.8 %). Besides, the adsorbent can be reutilized at least ten times, demonstrating satisfactory reusability. This work provided an effective method for the analysis and determination of UV filters in drinks.