The effectiveness of stem cell therapies has been hampered by cell death and limited control over fate. These problems can be partially circumvented by using macroporous biomaterials that improve the survival of transplanted stem cells and provide molecular cues to direct cell phenotype. Stem cell behaviour can also be controlled in vitro by manipulating the elasticity of both porous and non-porous materials, yet translation to therapeutic processes in vivo remains elusive. Here, by developing injectable, void-forming hydrogels that decouple pore formation from elasticity, we show that mesenchymal stem cell (MSC) osteogenesis in vitro, and cell deployment in vitro and in vivo, can be controlled by modifying, respectively, the hydrogel's elastic modulus or its chemistry. When the hydrogels were used to transplant MSCs, the hydrogel's elasticity regulated bone regeneration, with optimal bone formation at 60 kPa. Our findings show that biophysical cues can be harnessed to direct therapeutic stem cell behaviours in situ.