Prey selection in many species is known to change ontogenetically, suggesting that associated changes in trophic structure may also be important. Several studies have examined relationships between prey selection and the size of trophic structures; however, few have explored these changes over ontogeny or the effects that they may have on a species broader ecology. The present study addressed this issue by examining relationships between changes in head size and prey selection in juveniles and adults from three populations of the python Morelia viridis and related them to changes in sexual maturity and ontogenetic changes in colour (OCC). Our scaling data for head size showed that juveniles and adults scaled mostly with negative allometry, and allometric slopes were significantly different before and after OCC. The change in head shape allometry was strongly associated with changes in prey selection from ectothermic to endothermic prey and with OCC in two of the three populations studied. OCC in the other population varied widely and may be the result of isolation on an oceanic island. Negatively allometric head growth is common in vertebrates and may serve a functional role in M. viridis by reducing the maximum ingestible prey size in adults, thus aiding arboreality. Our data do not allow us to test which of these changes have causal or resultant effects on one another; however, we suggest they may be part of an overall evolutionary defence–foraging strategy that circumvents costs imposed by restricting foraging opportunities to certain habitats. © 2012 The Linnean Society of London, Biological Journal of the Linnean Society, 2012, ••, ••–••.