The development of the foetal heart is driven by increased glucose uptake and activation of mammalian target of rapamycin (mTOR) and hypoxia‐inducible factor‐1α (HIF‐1α), which drives glycolysis. In contrast, the healthy adult heart is governed by sirtuin‐1 (SIRT1) and adenosine monophosphate‐activated protein kinase (AMPK), which promote fatty‐acid oxidation and the substantial mitochondrial ATP production required for survival in a high‐workload normoxic environment. During cardiac injury, the heart recapitulates the foetal signalling programme, which (although adaptive in the short term) is highly deleterious if sustained for long periods of time. Prolonged increases in glucose uptake in cardiomyocytes under stress leads to increased flux through the hexosamine biosynthesis pathway; its endproduct – uridine diphosphate N‐acetylglucosamine (UDP‐GlcNAc) – functions as a critical nutrient surplus sensor. UDP‐GlcNAc drives the post‐translational protein modification known as O‐GlcNAcylation, which rapidly and reversibly modifies thousands of intracellular proteins. Both O‐GlcNAcylation and phosphorylation act at serine/threonine residues, but whereas phosphorylation is regulated by hundreds of specific kinases and phosphatases, O‐GlcNAcylation is regulated by only two enzymes, O‐GlcNAc transferase (OGT) and O‐GlcNAcase (OGA), which adds or removes GlcNAc (N‐acetylglucosamine), respectively, from target proteins. Recapitulation of foetal programming in heart failure (regardless of diabetes) is accompanied by marked increases in O‐GlcNAcylation, both experimentally and clinically. Heightened O‐GlcNAcylation in the heart leads to impaired calcium kinetics and contractile derangements, arrhythmias related to activation of voltage‐gated sodium channels and Ca2+/calmodulin‐dependent protein kinase II, mitochondrial dysfunction, and maladaptive hypertrophy, microvascular dysfunction, fibrosis and cardiomyopathy. These deleterious effects can be prevented by suppression of O‐GlcNAcylation, which can be achieved experimentally by upregulation of AMPK and SIRT1 or by pharmacological inhibition of OGT or stimulation of OGA. The effects of sodium–glucose cotransporter 2 (SGLT2) inhibitors on the heart are accompanied by reduced O‐GlcNAcylation, and their cytoprotective effects are reportedly abrogated if their action to suppress O‐GlcNAcylation is blocked. Such an action may represent one of the many mechanisms by which enhanced AMPK and SIRT1 signalling following SGLT2 inhibition leads to cardiovascular benefits. These observations, taken collectively, suggest that UDP‐GlcNAc functions as a critical nutrient surplus sensor (which acting in concert with mTOR and HIF‐1α) can promote the development of cardiomyopathy.