Gardenia jasminoides Ellis. polysaccharide (GPS) can protect against cholestatic liver injury (CLI) by regulating nuclear farnesoid X receptor (FXR).However, the mechanism via which GPS mediates the FXR pathway remains unclear. The aim of this study was to investigate the mechanism. Firstly, an alpha‐naphthylisothiocyanate‐induced cholestatic mouse model was administered with GPS to evaluate its hepatoprotective effects. The metabolic pathways influenced by GPS in cholestatic mice were detected by serum metabolomics. The effect of GPS on bile acid (BA) homeostasis, FXR expression, and liver inflammation were investigated. Second, the intestinal bacteria metabolites affected by GPS in vivo and in vitro were determined. The activation of FXR by sodium butyrate (NaB) was measured. Finally, the effects of NaB on cholestatic mice were demonstrated. The main pathways influenced by GPS involved BA biosynthesis. GPS upregulated hepatic FXR expression, improved BA homeostasis, reduced F4/80+ and Ly6G+ positive areas in the liver, and inhibited liver inflammation in cholestatic mice. Butyric acid was the most notable intestinal bacterial metabolite following GPS intervention. NaB activated the transcriptional activity of FXR in vitro, upregulated hepatic FXR and its downstream efflux transporter expression, and ameliorated disordered BA homeostasis in CLI mice. NaB inhibited the toll‐like receptor 4/nuclear factor (TLR4/NF‐κB) pathway and reduced inflammation and CLI in mice. An FXR antagonist suppressed the effects. In conclusion, GPS increased butyric acid production, which can activate hepatic FXR, reverse BA homeostasis disorder, and inhibit the TLR4/NF‐κB inflammatory pathway, exerting protective effects against CLI.