Lifestyle factors, especially exercise, impact the manifestation and progression of psychiatric and neurodegenerative disorders such as depression and Alzheimer’s disease, mediated by changes in hippocampal neuroplasticity. The beneficial effects of exercise may be due to its promotion of adult hippocampal neurogenesis (AHN). Gut microbiota has also been showed to be altered in a variety of brain disorders, and disturbances of the microbiota have resulted in alterations in brain and behaviour. However, whether exercise can counteract the negative effects of altered gut microbiota on brain function remains under explored. To this end, chronic disruption of the gut microbiota was achieved using an antibiotic cocktail in rats that were sedentary or allowed voluntary access to running wheels. Sedentary rats with disrupted microbiota displayed impaired performance in hippocampal neurogenesis-dependent tasks: the modified spontaneous location recognition task and the novelty suppressed feeding test. Performance in the elevated plus maze was also impaired due to antibiotics treatment. These behaviours, and an antibiotics-induced reduction in AHN were attenuated by voluntary exercise. The effects were independent of changes in the hippocampal metabolome but were paralleled by caecal metabolomic changes. Taken together these data highlight the importance of the gut microbiota in AHN-dependent behaviours and demonstrate the power of lifestyle factors such as voluntary exercise to attenuate these changes.