The incidence of ulcerative colitis (UC) is increasing annually, and UC has a serious impact on patients' lives. Polysaccharides have gained attention as potential drug candidates for treating ulcerative colitis (UC) in recent years. Huaier (Trametes robiniophila Murr) is a fungus that has been used clinically for more than 1000 years, and its bioactive polysaccharide components have been reported to possess immunomodulatory effects, antitumour potential, and renoprotective effects. In this study, we aimed to examine the protective effects and mechanisms of Huaier polysaccharide (HP) against UC. Based on the H2O2-induced oxidative stress model in HT-29 cells and the dextran sulphate sodium salt (DSS)-induced UC model, we demonstrated that Huaier polysaccharides significantly alleviated DSS-induced colitis (weight loss, elevated disease activity index (DAI) scores, and colonic shortening). In addition, HP inhibited oxidative stress and inflammation and alleviated DSS-induced intestinal barrier damage. It also significantly promoted the expression of the mucin Muc2. Furthermore, HP reduced the abundance of harmful bacteria Escherichia-Shigella and promoted the abundance of beneficial bacteria Muribaculaceae_unclassified, Anaerotruncus, and Ruminococcaceae_unclassified to regulate the intestinal flora disturbance caused by DSS. Nontargeted metabolomics revealed that HP intervention would modulate metabolism by promoting levels of 3-hydroxybutyric acid, phosphatidylcholine (PC), and phosphatidylethanolamine (PE). These results demonstrated that HP had the ability to mitigate DSS-induced UC by suppressing oxidative stress and inflammation, maintaining the intestinal barrier, and modulating the intestinal flora. These findings will expand our knowledge of how HP functions and offer a theoretical foundation for using HP as a potential prebiotic to prevent UC.