Growing evidence from metagenome-wide association studies link multiple common disorders to microbial dysbiosis but effects of drug treatment are often not accounted for; here, the authors re-analyse two previous metagenomic studies of type 2 diabetes mellitus patients together with a novel cohort to determine the effects of the widely prescribed antidiabetic drug metformin and highlight the need to distinguish the effects of a disease from the effects of treatment on the gut microbiota. There is growing evidence from metagenome-wide association studies that several common human disorders, such as type 2 diabetes mellitus (T2D), are associated with intestinal dysbiosis, an unhealthy imbalance of the gut microbiota. However, the contribution of antidiabetic drug treatment to dysbiosis is often not accounted for. Oluf Pedersen and colleagues analysed two previous metagenomic studies of T2D patients that yielded divergent conclusions regarding the association of the disease with dysbiosis, together with a novel cohort, to determine the effects of the widely prescribed antidiabetic drug metformin. They find that metformin is indeed a confounding factor, but that a unified signature of gut microbiome shifts in T2D is still apparent. In recent years, several associations between common chronic human disorders and altered gut microbiome composition and function have been reported1,2. In most of these reports, treatment regimens were not controlled for and conclusions could thus be confounded by the effects of various drugs on the microbiota, which may obscure microbial causes, protective factors or diagnostically relevant signals. Our study addresses disease and drug signatures in the human gut microbiome of type 2 diabetes mellitus (T2D). Two previous quantitative gut metagenomics studies of T2D patients that were unstratified for treatment yielded divergent conclusions regarding its associated gut microbial dysbiosis3,4. Here we show, using 784 available human gut metagenomes, how antidiabetic medication confounds these results, and analyse in detail the effects of the most widely used antidiabetic drug metformin. We provide support for microbial mediation of the therapeutic effects of metformin through short-chain fatty acid production, as well as for potential microbiota-mediated mechanisms behind known intestinal adverse effects in the form of a relative increase in abundance of Escherichia species. Controlling for metformin treatment, we report a unified signature of gut microbiome shifts in T2D with a depletion of butyrate-producing taxa3,4. These in turn cause functional microbiome shifts, in part alleviated by metformin-induced changes. Overall, the present study emphasizes the need to disentangle gut microbiota signatures of specific human diseases from those of medication.