Ulcerative colitis (UC) is considered an immune disease, which is related to the dysbiosis of intestinal microbiota and disorders of the host immune system and metabolism. Sophora flavescens Aiton has been used for the clinical treatment of UC in China and East Asia for thousands of years. It has many traditional prescriptions and modern preparations, and its curative effects are definite. We are the first to report that the flavonoids in Sophora flavescens ( S. flavescens) Aiton EtOAc extract (SFE) could potentially attenuate the dextran sodium sulfate–induced UC in mice, which changed the current understanding of considering alkaloids as the only anti-UC pharmacological substances of S. flavescens Aiton. Based on the 16S rRNA gene sequencing and metabolomic analysis, it was found that the anti-UC effects of SFE were due to the regulation of gut microbiota, reversing the abnormal metabolisms, and regulation of the short-chain fatty acids synthesis. Notably, according to the interaction networks of specific bacteria and “bacteria and metabolites” co-expression network, the SFE could enrich the abundance of the commensal bacterium Lactobacillus, Roseburia, norank_f__Muribaculaceae, Anaerotruncus, Candidatus_Saccharimona, and Parasutterella, which are proposed as potentially beneficial bacteria, thereby playing vital roles in the treatment of UC.