A system for preparing soil specimens subjected to drying–wetting cycles while under vertical confining pressures was introduced with clayey soil specimens subjected to different drying–wetting histories, and then the relative performance was tested using consolidated undrained triaxial shear tests. Meanwhile, their soil water retention properties were also measured. The experimental results indicated that drying–wetting cycles lead to a rise in the matric suction for soil with a high moisture content and a decrease in matric suction for soil with a low moisture content. Partly owing to the higher pore water pressure, peak shear strength reduces gradually during drying–wetting cycles. The impacts of drying–wetting cycles on the hydromechanical properties of soil specimens during the first cycle are greater than those during the second and third cycles, as the highest matric suction of soil occurs during the first cycle. The vertical confining pressure is shown to limit the impact of drying–wetting cycles on the hydromechanical properties of soil effectively because of its restricting effects on the volumetric deformation of soil during the cycles.