Abstract Highly selective ion separation is crucial to engineering applications. In this work, inspired by the working mechanism of biological protein ion channels, inclusion of ion-imprinted conductive polymers inside metal-organic frameworks (MOFs) with size selective effect was considered for the effective separation of ions. In-situ polymerization of polypyrrole (PPy) with anion exchange behavior in the UiO-66 cages was performed to obtain a conductive chlorine ion-imprinted polymer film electrode (Cl-IIP@UiO-66) for the electrochemically selective separation of chloride ions (Cl−) from wastewater. Herein, the chlorine ion-imprinted conductive PPy chains not only tuned the pore size of UiO-66, but also provided ion and electron transport channels at the molecular scale. As a result, the Cl− ion exchange capacity of the Cl-IIP@UiO-66 coated electrode reached to 52.16 mg g−1 with an adsorption equilibrium time less than 4 h under the extra electric field. Meanwhile, the Cl-IIP@UiO-66 film exhibited high separation factors of 9.02, 10.29, 13.41 and 18.50 for Cl−/Br−, Cl−/F−, Cl−/SO42− and Cl−/PO43−, respectively, which was mainly attributed to the anion-imprinting effect and the nanostructure for the selective recognition for Cl− ions. Remarkably, based on the controlled swelling property of MOFs, the Cl-IIP@UiO-66 maintained superior electrochemical reversibility and durability over 98% even after 1000 uptake/release cycles. Hence, it is believed that such a novel electroactive Cl− ion-imprinted film electrode could be a promising candidate for wastewater treatment. Also, it opened a new pathway to develop novel MOF-based electroactive ion exchange materials for various ion separations.