Endometritis is persistent inflammation caused by bacteria, which can lead to infertility. Although traditional Chinese medicine (TCM) has been used to treat endometritis, the underlying mechanism is still unclear. Here, Baogong Decoction (BGD), a TCM compound, was used to treat mouse endometritis induced by Escherichia coli (E. coli), and then 16S rRNA sequencing and non-targeted metabolomics were used to investigate the change of uterine microbiota and metabolomes in serum and uterine after BGD treatment.Finally, the therapeutic effect of potential metabolites for treating mouse endometritis screened by combined omics analyses was verified using pathological model. The results showed that BGD treatment could effectively treat endometritis associated with the increasing relative abundance of Firmicutes, Bacteroides, Lactobacillus and Lactococcus, and the decreasing relative abundance of Cupriavidus and Proteobacteria. 133 and 130 metabolites were found to be potential biomarkers in serum and uterine tissue respectively.In serum and tissues, dehydroepiandrosterone (DHEA) and catechol were significantly increased in the BGD treatment versus the inflammation group.Results of combined omics analyses demonstrated that DHEA was positively correlated with changes in microbiota. Results of pathological model demonstrated that DHEA could cure endometritis effectively associated with the decreasing infiltration of inflammatory cells and expression of inflammatory factors in the uterus. In summary, our results demonstrated that BGD could cure endometritis in mice by modulating the structure of the uterine microbiota and its metabolites, in which DHEA may be one of the main components of the therapeutic effect of BGD.