Abstract A conjugated microporous organic polymer (TPA-Bp) comprised of triphenylamine (TPA) and 2,2′-bipyridine-5,5′-diformaldehyde (Bp) was prepared via the Schiff-base reaction under ambient conditions. TPA-Bp is an amorphous and microporous spherical nanoparticle with very high stability. TPA-Bp suspension in DMF displayed strong fluorescence emission and selective fluorescence quenching response towards Fe3+ and Fe2+ ions. The fluorescence intensity of TPA-Bp at 331 nm presents linear relationship with the concentrations of both Fe3+ and Fe2+ with low detection limits of 1.02 × 10−5 M for Fe3+ and 5.37 × 10−6 M for Fe2+. The results of X-ray photoelectron spectroscopy (XPS) and Fourier Transform infrared spectroscopy (FTIR) confirm the selective coordination of N atoms of pyridine unit with Fe ions. The fluorescence quenching of TPA-Bp upon the addition of Fe3+/Fe2+ ions can be attributed to the absorption competition quenching (ACQ) mechanism and the energy transfer between TPA-Bp and Fe3+/Fe2+ ions. This work demonstrates that the conjugated microporous polymers are promising candidates as luminescent sensor for detection of the special analytes in practical applications.