Shaoyao decoction (SYD) is a traditional Chinese medicine used to treat ulcerative colitis (UC). The exact mechanism of action of SYD in UC treatment is still unclear. Here, we examined the therapeutic effects of SYD in mice with dextran sulfate sodium (DSS)-induced colitis and explored the underlying mechanism. Methods: The experimental group was divided into normal control, UC, and SYD treatment groups. The UC model of C57BL/6 mice was induced using 3% (w/v) DSS for 7 days. SYD was orally administered for 7 days. The proximal and distal colonic metabolic profiles were detected using quadrupole-time-of-flight mass spectrometry-based untargeted metabolomics. Results: SYD significantly increased weight, reduced disease activity index scores, and ameliorated colon length shortening and pathological damage in mice. In the distal colon, SYD increased the abundance of phosphatidic acid and lysophosphatidylethanolamine and decreased the abundance of lactosylceramide, erythrodiol 3-palmitate, and lysophosphatidylcholine. In the proximal colon, SYD increased the abundance of palmitic acid, cyclonormammein, monoacylglyceride, 13S-hydroxyoctadecadienoic acid, and ceanothine C and decreased the abundance of tetracosahexaenoic acid, phosphatidylserine, and diglyceride. Conclusion: Our findings revealed that SYD could alleviate UC by regulating metabolic dysfunction, which provides a reference for further studies on SYD.