The current scenario of environmental pollution attributed to industrial ecotoxicants envisages the imperative necessity not just to detect highly toxic heavy metal ions but also to concurrently eliminate them, to ensure the sustainable safeguard of the environment. However, the contemporaneous detection and removal of mercury ions is seldom reported. Herein, a triazinebased porous organic polymer, POP CCAD, consisting of nitrogen-rich binding sites, has been designed and synthesized via a simple nucleophilic substitution reaction using cyanuric chloride and adenine as the starting materials. POP CCAD could achieve its application as a bifunctional material for the fluorescence sensing of Hg 2+ with a detection limit of 8.4 nM and a removal capacity of 460 mg g −1 . This work reveals the capability of porous organic polymers, serving not only as fluorescent sensors for mercury ions but also as molecular sieves for their separation.