Accurate assessment of the thermal buckling behavior of microdevices is critical for the safe and secure operation of MEMS. However, the coupling of shearing and size effects on the thermal buckling of microbeams remains elusive and needs to be clarified. Here, we propose a theoretical model for the thermal buckling of microbeams that considers both the shearing and size effects, based on the modified gradient elasticity theory combined with the Timoshenko beam model. The explicit analytical forms of the deflection, the bending angle, the shearing angle and the critical buckling temperature rise are presented. The results show that the bending angle increases with the length/thickness ratio while the shearing angle decreases. It is confirmed that the shearing effect cannot be ignored in the thermal buckling of the doubly clamped microbeams with low aspect ratio. The size effect is captured in the thermal buckling of microbeams, which shows an increase in thermoelastic strength with the size reduction. The coupling effect on thermal buckling shows a weakening of the shearing effect by the size effect as the microbeam size decreases. This work could provide a theoretical reference for the design and monitoring of microdevices operating in high temperature environments.