The synthesis of a conjugated polymer containing pyridyl units in the polymer backbone was successfully carried out with 2,6‐dibromopyridine and a diboronic acid derivative via the Suzuki coupling reaction. This polymer had a number‐average molecular weight of 4000 and excellent solubility in conventional organic solvents; this suggested the effect of the incorporation of dialkoxy side chains. A metallochromic phenomenon with ferric ions was clearly observed in spin‐coated films and solutions of the polymer. The response of the absorption and the fluorescence changes of the polymer films were rapid and were reproduced more than 15 times. A lightly bound intermolecular interaction between the pyridine ligand and cation was presumed to be responsible for the facile optical switching property of the polymer films. © 2004 Wiley Periodicals, Inc. J Polym Sci Part A: Polym Chem 42: 2444–2450, 2004