The solicitude to molecularly imprinted conjugated polymers is flourishing due to their auspicious properties for a myriad of technological and industrial applications. The preparation conditions strongly affect the structure, optical, thermal, and electrical properties of these polymers. Subsequently, a consistent contemplation is desired to entrench consanguinity between processing stipulations and these variables. Here, molecularly imprinted polyaniline films, based ascorbic acid as a template, have been synthesized via electropolymerization technique. This template has been extracted from the films to create microporous polyaniline films. The morphology and structure of these films were investigated using X-ray diffraction and Fourier transform infrared spectroscopy. Thermogravimetric test showed an enhancement in the thermal stability of molecular imprinted polyaniline compared with non-imprinted techniques. The optical measurements showed that the rate of light absorption is increased twice with low transmission and reflection. The electrical conductivity increased by four orders with activation energy of 0.30 eV. The optoelectronic measurements of molecularly imprinted microporous polyaniline films showed that the filling factor and external quantum efficiency are enhanced compared with non-imprinted polyaniline films. POLYM. COMPOS., 2013. © 2013 Society of Plastics Engineers