Inflammatory diseases of the gastrointestinal tract are frequently associated with dysbiosis, characterized by changes in gut microbial communities that include an expansion of facultative anaerobic bacteria of the Enterobacteriaceae family (phylum Proteobacteria). Here we show that a dysbiotic expansion of Enterobacteriaceae during gut inflammation could be prevented by tungstate treatment, which selectively inhibited molybdenum-cofactor-dependent microbial respiratory pathways that are operational only during episodes of inflammation. By contrast, we found that tungstate treatment caused minimal changes in the microbiota composition under homeostatic conditions. Notably, tungstate-mediated microbiota editing reduced the severity of intestinal inflammation in mouse models of colitis. We conclude that precision editing of the microbiota composition by tungstate treatment ameliorates the adverse effects of dysbiosis in the inflamed gut.