The harm caused by dye pollution in water or excessive dyes in food has seriously threatened human health, and thus the monitor and removal of the dyes in environmental water and food are of great signi cance. In present study, covalent organic framework (namely COF-TFTP), which was fabricated at room temperature by using 1,3,5-tris(p-formylphenyl) benzene and 1,3,5-tris(4-aminophenyl)benzene as building blocks, was employed as an adsrobent for solid-phase extraction (SPE) of dyes including congo red, methyl blue and direct red 80 for the rst time. The physicochemical properties of COF-TFTP were investigated by using SEM, TEM, XRD, XPS and so on. The results revealed that COF-TFTP showed uniform spherical structure, high crystallinity, satisfactory surface area, and good thermal stability. The results of adsorption experiments indicated that COF-TFTP had good adsorption capacities for congo red, methyl blue and direct red 80 (284.10, 177.62 and 55.25 mg⋅g − 1 ) and the adsorption equilibrium can be achieved in a relatively short time (15 min). Further, to achieve the best adsorption effects of COF-TFTP, the in uence parameters including pH, ionic strength, type of desorption solvent, the COF-TFTP dosage in SPE column, were optimized in turn. Finally, under the optimal SPE conditions, COF-TFTP based SPE was applied to the adsorption of congo red and methyl blue in food samples (e.g. pork and sh), to the adsorption of three dyes in water samples. The recoveries of dyes in environmental water samples (71.50-86.84%) and food samples (68.50-88.95%) were satisfactory, revealing the unique applicability of COF-TFTP in sample pretreatment eld.