Hydrogels are fascinating and useful in that they can show large volume changes in response to various stimuli, such as temperature or chemical environment. Here we report the peculiar observation that chemically crosslinked hydrogels that normally expand owing to a change in electrolyte pH can be made to shrink in certain circumstances. Specifically, these hydrogels contract when tested at a constant compressive force and subjected to a pH change that causes expansion in the absence of the applied load. When tested under tension, the gels always expand. Although the effects of external stress on the swelling of gels is known, the concomitant change in gel mechanical properties during pH switching was found to be a more dominant effect in our studies. However, existing mechanical modelsused to predict dimensional changes in actuator materials could not explain both the tensile and compression results. In addition, we show that the friction between metal plates of the apparatus and the gel is a key factor in explaining the contractile actuation under compressive loads. The observations reported in this paper are important for the successful design and use of hydrogel actuators in devices such as valves for microfluidics.