The Anderson–Grüneisen theory of the thermal expansivity of solids has been modified so as to make it applicable for the entire range of compressions down to extreme compression in the limit of infinite pressure. The formulation for the pressure dependence of thermal expansivity has been developed using the thermodynamic constraints at boundary conditions. The volume–pressure–temperature data obtained from the Stacey reciprocal [Formula: see text] equation of state are used to determine the thermal expansivity of NaCl and MgO at simultaneously elevated pressures and temperatures. The results have been discussed and compared with recent studies.