Micropollutants are found in all water sources, even after thorough treatments that include membrane filtration. New ones emerge as complex molecules are continuously produced and discarded after used. Treatment methods and sorbent designs are mainly based on non-specific interactions and, therefore, have been elusive. Here, we developed swellable covalent organic polymers (COP) with great affinity towards micropollutants, such as textile industry dyes. Surprisingly, only cationic dyes in aqueous solution were selectively and completely removed. Studies of the COPs surfaces led to a gating capture, where negatively charged layer attracts cationic dyes and moves them inside the swollen gel through diffusive and hydrophobic interaction of the hydrocarbon fragments. Despite its larger molecular size, crystal violet has been taken the most, 13.4 mg g−1, surpassing all competing sorbents. The maximum adsorption capacity increased from 12.4 to 14.6 mg and from 8.9 to 11.4 mg when the temperature of dye solution was increased from 20 to 70 °C. The results indicated that disulfide-linked COPs are attractive candidates for selectively eliminating cationic dyes from industrial wastewater due to exceptional swelling behaviour, low-cost and easy synthesis.