Designed porous materials, such as covalent organic frameworks (COFs), are promising materials for the removal of toxic metals from wastewater. To assess the contamination and removal of toxic metal ions, their ultrasensitive detection is extremely important. However, to date, there have been very few reports on the ultrasensitive (picomolar) detection of toxic metal ions using highly porous COFs. Therefore, in this study, we synthesized a highly porous and durable COF containing amine and sulfonyl groups using the hydrothermal method. We demonstrated the impressive performance of obtained COF for the selective and ultrasensitive detection of Hg2+. Owing to its excellent luminescence properties and highly p-conjugated system, this metal-free COF can be used as a signal transducer for the selective and sensitive detection of Hg2+ at the picomolar level (640 pM). We studied the influence of various factors (e.g., pH, concentration, and temperature) on the sensitive detection of Hg2+. Owing to excellent luminescence properties and ultrasensitive detection of Hg2+, COF works as highly adsorbent materials for Hg2+ with the effective removal capacity of 99.8% at neutral pH. The obtained COF was also applied as a probe for the simultaneous detection and removal of Hg2+ in a natural river water sample. The results indicate a new path toward metal-free chemical sensors for toxic pollutants.