Mass loss from the Antarctic Ice Sheet to the ocean has increased in recent decades, largely because the thinning of its floating ice shelves has allowed the outflow of grounded ice to accelerate1,2. Enhanced basal melting of the ice shelves is thought to be the ultimate driver of change2,3, motivating a recent focus on the processes that control ocean heat transport onto and across the seabed of the Antarctic continental shelf towards the ice4–6. However, the shoreward heat flux typically far exceeds that required to match observed melt rates2,7,8, suggesting that other critical controls exist. Here we show that the depth-independent (barotropic) component of the heat flow towards an ice shelf is blocked by the marked step shape of the ice front, and that only the depth-varying (baroclinic) component, which is typically much smaller, can enter the sub-ice cavity. Our results arise from direct observations of the Getz Ice Shelf system and laboratory experiments on a rotating platform. A similar blocking of the barotropic component may occur in other areas with comparable ice–bathymetry configurations, which may explain why changes in the density structure of the water column have been found to be a better indicator of basal melt rate variability than the heat transported onto the continental shelf9. Representing the step topography of the ice front accurately in models is thus important for simulating ocean heat fluxes and induced melt rates.