The rare earth titanates show unusual types of short range magnetic order, known as spin liquid and spin ice states, which arise from the geometrical frustration of the pyrochlore lattice. We have investigated the effect of applied pressures on these magnetic states by means of powder neutron diffraction, up to 8 GPa. In the spin liquid Tb2Ti2O7, pressure induces a long range antiferromagnetic order, coexisting with the spin liquid state below the Neel temperature (T-N = 2.1 K). The onset of long range order coincides with a strong decrease of the diffuse intensity, due to a gradual transfer from the liquid to the ordered state as the temperature decreases. The short range correlations are also modified under pressure, even above TN. In contrast, in Ho2Ti2O7 the spin ice state remains stable under pressure, as was checked up to 6 GPa, and down to 1.4 K. The short range correlations are unaffected here. The possible origins of this behaviour are discussed.