Heterostructures can be assembled from atomically thin materials by combining a wide range of available van der Waals crystals, providing exciting possibilities for designer electronics 1 . In many cases, beyond simply realizing new material combinations, interlayer interactions lead to emergent electronic properties that are fundamentally distinct from those of the constituent layers 2 . A critical parameter in these structures is the interlayer coupling strength, but this is often not easy to determine and is typically considered to be a fixed property of the system. Here we demonstrate that we can controllably tune the interlayer separation in van der Waals heterostructures using hydrostatic pressure, providing a dynamic way to modify their electronic properties. In devices in which graphene is encapsulated in boron nitride and aligned with one of the encapsulating layers, we observe that increasing pressure produces a superlinear increase in the moiré-superlattice-induced bandgap-nearly doubling within the studied range-together with an increase in the capacitive gate coupling to the active channel by as much as 25 per cent. Comparison to theoretical modelling highlights the role of atomic-scale structural deformations and how this can be altered with pressure. Our results demonstrate that combining hydrostatic pressure with controlled rotational order provides opportunities for dynamic band-structure engineering in van der Waals heterostructures.