Polycystic ovary syndrome (PCOS) is characterized by androgen excess, ovulatory dysfunction and polycystic ovaries1, and is often accompanied by insulin resistance2. The mechanism of ovulatory dysfunction and insulin resistance in PCOS remains elusive, thus limiting the development of therapeutics. Improved metabolic health is associated with a relatively high microbiota gene content and increased microbial diversity3,4. This study aimed to investigate the impact of the gut microbiota and its metabolites on the regulation of PCOS-associated ovarian dysfunction and insulin resistance. Here, we report that Bacteroides vulgatus was markedly elevated in the gut microbiota of individuals with PCOS, accompanied by reduced glycodeoxycholic acid and tauroursodeoxycholic acid levels. Transplantation of fecal microbiota from women with PCOS or B. vulgatus-colonized recipient mice resulted in increased disruption of ovarian functions, insulin resistance, altered bile acid metabolism, reduced interleukin-22 secretion and infertility. Mechanistically, glycodeoxycholic acid induced intestinal group 3 innate lymphoid cell IL-22 secretion through GATA binding protein 3, and IL-22 in turn improved the PCOS phenotype. This finding is consistent with the reduced levels of IL-22 in individuals with PCOS. This study suggests that modifying the gut microbiota, altering bile acid metabolism and/or increasing IL-22 levels may be of value for the treatment of PCOS.