The effect of temperature on structural modal characteristics plays an important role in structural health monitoring and evaluation. Herein, the free vibration analysis of rigid-frame bridge is conducted by taking into account the effect of temperature. Firstly, the non-uniform rigid-frame bridge is divided into several members to develop the flexural and axial vibration equations for members under the effect of temperature in accordance with Hamilton’s principle. Secondly, each member is further divided into several segments, and the transfer relationship between segments is established to obtain the generalized dynamic stiffness matrix of the member. Then, the generalized dynamic stiffness matrix of each member is constructed by using the numerical assembly method similar to the finite element method so as to obtain the characteristic equation of rigid-frame bridge. Furthermore, the natural frequency and mode shape of the whole rigid-frame bridge are calculated by using the algorithm of Wittrick-Williams. Finally, the dynamic characteristic test of Yong-an bridge and the numerical calculation of the rigid-frame bridge are carried out to verify the generality and accuracy of the proposed method. The results indicate that the change of temperature will lead to the secondary internal force and the change of Young’s modulus, which together affect the modal characteristics of the structure, and the change of natural frequency caused by the change of Young’s modulus is greater than that caused by the secondary internal forces. In addition, there is a negative correlation between temperature and natural frequency of the rigid-frame bridge, and different temperature gradient modes also have certain influence on the mode shape of rigid-frame bridge.