The systematic study of two ionic porous organic polymers (iPOPs) based on viologens and their first applications in the electrochromic field are reported. The viologen‐based iPOPs were synthesized by electrochemical polymerization with cyano groups, providing a simple and controllable method for iPOPs which solves the film preparation problems common to viologens. After characterisation of these iPOPs a detailed study of their electrochromic properties was conducted. The iPOPs films based on viologens structure exhibit excellent electrochromic properties. In addition, the resulting iPOPs films show highly sensitivity to electrolyte ions of different sizes in the redox process. Electrochemical and electrochromic data of the iPOPs explain this phenomenon in detail. These results demonstrate that iPOPs of this type are ideal candidates as electrochromic materials due to their inherent porous structures and ion‐rich properties.This article is protected by copyright. All rights reserved