The mammalian gut microbiota influences a wide array of phenotypes and is considered a key determinant of 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. We 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 to a similar extent 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 further identify a candidate maternally-transmitted bacterial family in wood mice, the Lactobacillaceae. Overall, our findings suggest a shifting transmission landscape for wild mice, with a mother's influence on microbiota composition waning as offspring age, while the impact of social contacts remains strong and consistent.