We investigated both time and temperature dependence of chromophore movements by means of in situ second‐harmonic generation (SHG) measurements. Using real‐time detection of the SHG intensities during and after poling of various nonlinear‐optical polymer films we observed differences between main‐chain and side‐chain polymers regarding the nonlinear coefficients d33 and the glass transition dynamics. We present experimental data on new main‐chain polymers with polar stilbene chromophores attached in the most common transverse position to the backbones (MC‐T) or incorporated in a linear fashion where they are a part of the main‐chain (MC‐L). The side‐chain polymer (SC) presented here has been developed for photorefractive applications and is a copolymer containing Disperse Red 1 and a photoconducting carbazole unit in the side chain. The influence of the macromolecular structure on the chromophore dynamics is striking. This is verified by means of in situ corona poling experiments and thermal experiments based on temperature ramps on poled polymers. MC‐T and especially MC‐L polymers show a better thermal stability of the chromophore orientation relative to the glass transition temperature than SC polymers; however, chromophores of main‐chain polymers are, as can be expected, less mobile during the poling process. We obtained resonance enhanced nonlinear optical coefficients d33 of 100 pm/V in a SC polymer, 90 pm/V in a MC‐T polymer, and 30 pm/V in a MC‐L polymer. © 1996 American Institute of Physics.