In this study, monodisperse, uniform, and spherical covalent organic frameworks (COFs) were synthesized using 1,3,5‐tris (4‐aminophenyl) benzene and 1,3,5‐tricarboxaldehyde benzene at room temperature. Post‐modification of 6‐aminocaproic acid on the COFs yielded carboxyl‐modified COFs (COFs‐COOH). The modification enhanced the hydrophilicity and adsorption efficiencies of COFs‐COOH for malachite green (MG) and crystal violet (CV). A COFs‐COOH‐based dispersive solid‐phase extraction coupled with high‐performance liquid chromatography was developed for the analysis of MG and CV. The method showed a linear range from 10 to 1000 ng/mL with detection limits of 1.82 and 0.70 ng/mL for MG and CV detection, respectively. The recoveries of MG and CV from water samples collected from fish farms and markets ranged from 91.63% to 107.10% with relative standard deviations below 5%. Reproducibility tests demonstrated that the adsorption efficiencies of COFs‐COOH were maintained at above 85.86% over 15 cycles. The study verified the potential of COFs‐COOH as sorbents for the enrichment and separation of triphenylmethane dyes from complex samples.