BackgroundThe mammalian gut microbiota influences a wide array of phenotypes which are relevant to fitness, yet knowledge about the transmission routes by which gut microbes colonise hosts in natural populations remains limited. Here, we use an intensively studied wild population of wood mice (Apodemus sylvaticus) to examine how vertical (maternal) and horizontal (social) transmission routes influence gut microbiota composition throughout life.ResultsWe identify independent signals of maternal transmission (sharing of taxa between a mother and her offspring) and social transmission (sharing of taxa predicted by the social network), whose relative magnitudes shift as hosts age. In early life, gut microbiota composition is predicted by both maternal and social relationships, but by adulthood the impact of maternal transmission becomes undetectable, leaving only a signal of social transmission. By exploring which taxa drive the maternal transmission signal, we identify a candidate maternally-transmitted bacterial family in wood mice, theMuribaculaceae.ConclusionOverall, our findings point to an ontogenetically shifting transmission landscape in wild mice, with a mother’s influence on microbiota composition waning as offspring age, while the relative impact of social contacts grows.Supplementary InformationThe online version contains supplementary material available at 10.1186/s42523-023-00247-7.