Sophora alopecuroides L is one of the most commonly used plants in traditional medicine for the management conditions including inflammatory and gastrointestinal disease. However, the therapeutic mechanism of Sophora alopecuroides L.particularly in inflammatory bowel disease (IBD) remains unclear. To evaluate the treatment effects of total alkaloids of Sophora alopecuroides L. in a ulcerative colitis (UC) mouse model and explore the therapeutic mechanism of KDZ on UC based on bile acid metabolism and gut microbiota. Colitis was induced in BALB/c mice by administering 3% dextran sulfate sodium (DSS) in drinking water for 7 days. The mice were then given KDZ (300, 150, and 75 mg/kg) and the positive drug sulfasalazine (SASP, 450 mg/kg) via oral administration for 7 days. The levels of 23 bile acids in the liver, bile, serum, cecum content, and colon were determined through ultra-performance liquid chromatography/tandem mass spectrometry (UPLC-MS/MS). The cecum microbiota was characterized through high-throughput Illumina MiSeq sequencing. KDZ treatment significantly increased the disease activity index (DAI) scores and ameliorated colonic injury in DSS-treated mice. The expression of IL-1β, TGF-β1 were suppressed, yet, IL-10 was up-regulated by KDZ and SASP treatment compared to the model group. Meanwhile, the serum contents of total bile acid and total cholesterol in the DSS group increased significantly compared with those in the control group, but reversed by SASP and KDZ. The relative abundance of Firmicutes increased after KDZ administration, whereas the amount of Bacteroidetes decreased. αMCA, βMCA, ωMCA, and CA in the SASP and KDZ groups did not differ from those in the control group, whereas these parameters significantly increased in the DSS group. KDZ had a protective effect on DSS-induced colitis by mitigating colonic injury, preventing gut microbiota dysbiosis, and regulating bile acid metabolism. Copyright © 2020. Published by Elsevier B.V.