Composite films of polypyrrole with a sulphonated organically modified silica (ormosil) have been prepared on electrodes by the electrochemical oxidation of pyrrole in a liquid sol–gel electrolyte. The ormosil is incorporated into the polypyrrole matrix as an immobile polymeric counterion in addition to mobile Cl− counterions from the sol–gel electrolyte. Ion transport in the composites was investigated by impedance spectroscopy and electron microprobe analysis. The presence of both mobile and immobile counterions allows potential control of the mode of ion transport, with anion transport dominating at high potentials and cation transport dominating at low potentials. As the polymer is un-doped (reduced), its ionic conductivity first decreases as mobile anions are expelled, and then increases as cations and excess electrolyte are incorporated.