Near-surface unsaturated soils can be exposed to elevated temperatures due to soil-atmospheric interactions under drought events, wildfires, heatwaves, and warm spells, or the heat induced by emerging geotechnical and geo-environmental technologies such as geothermal boreholes and thermally active earthen systems. Elevated temperatures can affect the hydro-mechanical characteristics of unsaturated soils, which in turn can alter lateral earth pressures developed in the backfill soil. The main objective of this study is to quantify the effect of elevated temperatures on active and passive earth pressures of unsaturated soils. For this purpose, the paper presents the derivation of an analytical framework to extend Rankine’s earth pressure theory to account for the effect of temperature under hydrostatic conditions. The equations are derived by incorporating the effect of temperature into the soil water retention curve and a suction stress-based effective stress representation. The proposed effective stress equation considers the temperature-induced changes in the contact angle, surface tension, and enthalpy of immersion. To investigate the impact of temperature on active and passive earth pressures, the proposed method is then used in a set of parametric studies to determine active and passive earth pressure profiles for three hypothetical soils of clay, silt, and sand at different temperatures. Results suggest that elevated temperatures can cause variation in active and passive earth pressures for all the soils considered. The findings of this study can contribute toward analyzing earth retaining structures subjected to elevated temperatures.