Electrostriction is the strain response of a dielectric material proportional to the square of an applied electric field. This effect is related to the strain-dependence of the dielectric function. The strain signal observed using optical interferometry is a superposition of true electrostriction and other effects like electrostatic forces and thermal stresses. Therefore, it is necessary to have a formula that allows the measured values to be corrected for these spurious effects. In this paper, a thermodynamic approach and the force law are used, combining continuum mechanics and Maxwell's electromagnetic equations, to derive a correction formula. The result can be applied to measurements of both the longitudinal and the transversal effect in single crystals of any symmetry.