AbstractFast‐flowing ice streams in West Antarctica are separated from the nearly stagnant ice in the adjacent ridge by zones of highly localized deformation known as shear margins. It is presently uncertain what mechanisms control the location of shear margins and possibly allow them to migrate. In this paper we show how subglacial hydrological processes can select the shear margin location, leading to a smooth transition from a slipping to a locked bed at the base of an ice stream. Our study uses a two‐dimensional thermomechanical model in a cross section perpendicular to the direction of flow. We confirm that the intense straining at the shear margins can generate large temperate regions within the deforming ice. Assuming that the melt generated in the temperate ice collects in a drainage channel at the base of the margin, we show that a channel locally decreases the pore pressure in the subglacial till. Therefore, the basal shear strength just outside the channel, assuming a Coulomb‐plastic rheology, can be substantially higher than that inferred under the majority of the stream. Results show that the additional basal resistance produced by the channel lowers the stress concentrated on the locked portion of the bed. Matching the model to surface velocity data, we find that shear margins are stable when the slipping‐to‐locked bed transition occurs less than 500 m away from a channel operating at an effective pressure of 200 kPa and for a hydraulic transmissivity equivalent to a basal water film of order 0.2 mm thickness.