Medications you took years ago may still be shaping your gut bacteria today, according to a large new study — and the effect isn’t limited to antibiotics.

Researchers at the University of Tartu Institute of Genomics, led by Dr. Oliver Aasmets, analyzed stool samples and prescription records from more than 2,500 participants in the Estonian Biobank. They found lasting changes in the gut microbiome linked to several common drug classes: antibiotics (penicillins, macrolides), antidepressants (SSRIs), beta-blockers, proton pump inhibitors (acid reducers), and benzodiazepines. Some changes “could still be detected years after people had stopped taking the medication.” The work was published in mSystems.

A surprise culprit

One unexpected finding: benzodiazepines — anxiety and sleep medications that aren’t antimicrobial — showed effects on gut bacteria “comparable to those seen with broad-spectrum antibiotics.”

Why it matters — and the caveats

The gut microbiome influences digestion, immunity and more, and it’s increasingly studied in disease. A practical takeaway from the authors: microbiome-disease research should account for people’s medication history, so drug effects aren’t mistaken for disease-related changes. This is an observational study showing associations, not proof that these drugs cause harm, and the longitudinal follow-up involved a relatively small group. It’s not a reason to stop any prescribed medication. This article summarizes research and is not medical advice.