In this work, we reported a modified COF material for trinitrophenol (TPA) ratiometric sensing and removal. Here a cationic covalent organic framework (C-COF) was prepared as host, while two Tb(III)-based ions were doped into C-COF as probe by ionic exchange reaction with probe loading level of ∼15%. In the absence of TPA, weak Tb(III) emission (489 nm, 545 nm, 585 nm) and bright red COF emission were observed (633 nm). The addition of TPA increased Tb(III) emission and decreased COF emission, following linear response within TPA concentration region of 0-9 μM. Their limit of detection values were determined as 0.9 μM and 4.5 μM, respectively. Corresponding working equations were fitted as I/I0 = 1.225 + 6.914 × 105 M-1[TPA], R2 = 0.997 for TbCF3-COF and I/I0 = 1.063 + 9.222 × 104 M-1 [TPA], R2 = 0.993 for TbDBM-COF. TbCF3-COF showed better sensing performance than TbDBM-COF, due to its suitable ligand triplet energy level. Their sensing mechanism was revealed as dopant "replacement", where dopant molecules loaded in COF micropore were replaced by TPA molecules, accompanied with energy competing on Tb(III) 5D4 level, showing ratiometric signals. Good selectivity and removal capacity (∼7.4 wt%) for TPA were achieved.