Cell migration through extracellular matrices requires nuclear deformation, which depends on nuclear stiffness. In turn, chromatin structure contributes to nuclear stiffness, but the mechanosensing pathways regulating chromatin during cell migration remain unclear. Here, we demonstrate that WD repeat domain 5 (WDR5), an essential component of H3K4 methyltransferase complexes, regulates cell polarity, nuclear deformability, and migration of lymphocytes in vitro and in vivo, independent of transcriptional activity, suggesting nongenomic functions for WDR5. Similarly, depletion of RbBP5 (another H3K4 methyltransferase subunit) promotes similar defects. We reveal that a 3D environment increases the H3K4 methylation dependent on WDR5 and results in a globally less compacted chromatin conformation. Further, using atomic force microscopy, nuclear particle tracking, and nuclear swelling experiments, we detect changes in nuclear mechanics that accompany the epigenetic changes induced in 3D conditions. Indeed, nuclei from cells in 3D environments were softer, and thereby more deformable, compared with cells in suspension or cultured in 2D conditions, again dependent on WDR5. Dissecting the underlying mechanism, we determined that actomyosin contractility, through the phosphorylation of myosin by MLCK (myosin light chain kinase), controls the interaction of WDR5 with other components of the methyltransferase complex, which in turn up-regulates H3K4 methylation activation in 3D conditions. Taken together, our findings reveal a nongenomic function for WDR5 in regulating H3K4 methylation induced by 3D environments, physical properties of the nucleus, cell polarity, and cell migratory capacity.