Medications you stopped taking years ago could still be shaping the bacteria that live in your gut. A large-scale study from the University of Tartu Institute of Genomics reveals that many commonly prescribed drugs leave enduring imprints on the gut microbiome, persisting long after people have discontinued them.
The gut microbiome is the sprawling community of bacteria and other microorganisms that reside in the digestive tract. These microbes are essential to digestion, immune defense, and overall well-being. Although antibiotics are widely recognized for disturbing gut bacteria, the new research indicates that a broad range of other medications can produce effects that linger for years.
To explore these links, researchers analyzed stool samples alongside prescription records from more than 2,500 participants in the Estonian Biobank’s Estonian Microbiome cohort. They found that the majority of the medications examined were tied to shifts in gut bacteria. Even more striking, a considerable number left detectable microbial “fingerprints” years after patients had stopped taking them.
Common Drugs Leave Lasting Imprints on Gut Bacteria
The findings reach well beyond antibiotics. Antidepressants, beta-blockers, proton pump inhibitors, and benzodiazepines were all associated with measurable differences in the gut microbiome.
These drugs are routinely used to manage everyday health conditions. Beta-blockers are frequently prescribed for high blood pressure and certain heart conditions, while proton pump inhibitors curb stomach acid and are commonly used to treat acid reflux. Benzodiazepines are often given for anxiety, and antidepressants help manage depression and other mental health disorders.
“Most microbiome studies only account for current medications, but our results show that past drug use can be just as important, and it is a surprisingly powerful factor in explaining differences between individual microbiomes,” said Dr. Oliver Aasmets, the study’s lead author.
This discovery suggests that focusing only on the drugs a person currently takes may overlook a significant chapter of their gut health history. Earlier prescriptions could help explain why gut bacterial composition varies so dramatically from one person to the next.
Anxiety Drugs Show Effects on Par With Antibiotics
Among the most remarkable findings was the impact of benzodiazepines, a class of drugs commonly prescribed for anxiety.
Researchers found that these medications were linked to changes in the gut microbiome comparable to those seen with broad-spectrum antibiotics. Such antibiotics attack a wide array of bacteria and are known to dramatically reshape the microbial communities inhabiting the digestive system.
The team also observed that drugs within the same class did not necessarily behave the same way. Diazepam and alprazolam, for instance, are both benzodiazepines used to treat similar conditions, yet they appeared to differ in how strongly they disrupted gut bacteria.
This implies that a medication’s effect on the microbiome may hinge not only on the class of drug, but also on the specific compound being taken.
Gut Bacteria Shift When Drugs Are Begun or Discontinued
To determine whether the medications were genuinely driving these microbial changes, researchers collected additional stool samples from a smaller group of participants.
By tracking how the microbiome shifted when people started or stopped particular drugs, the team pinpointed predictable patterns in gut bacteria. These results offered further evidence that the drugs themselves were driving the changes, rather than merely coinciding with differences already present in patients.
Although the follow-up analysis involved a relatively small group, the researchers were able to confirm lasting effects tied to several drug categories. These included proton pump inhibitors, selective serotonin reuptake inhibitors, and certain antibiotics, such as combinations of penicillins and macrolides.
Selective serotonin reuptake inhibitors, commonly known as SSRIs, are a widely prescribed class of antidepressants. Macrolides are a group of antibiotics used to treat a range of bacterial infections.
Why Your Medication History May Matter More Than Expected
The findings carry an important lesson for scientists studying the connection between gut bacteria and disease. Differences in the microbiome may reflect not only a person’s current health and medication use, but also treatments received years earlier.
When prior medications go unaccounted for, researchers could mistakenly blame certain microbial differences on a disease or another health factor, when past drug exposure may have been the real contributor.
The results also underscore how much remains unknown about the long-term relationship between medications and the gut microbiome. While the study identified persistent microbial changes, these findings do not prove that such changes are harmful or that they cause specific health problems.
“This is a comprehensive, systematic evaluation of the long-term effects of medications on the microbiome, drawing on real-world medical health records,” said Professor Elin Org, the study’s corresponding author. “We hope this encourages researchers and clinicians to take medication history into account when interpreting microbiome data.”


