Anxiety is one of the complications of metabolic disorders (MDs). Obeticholic acid (OCA), the bile acids (BAs) derivative, is a promising agent for improving MDs in association with gut dysbiosis. Yet, its protective effect on MDs-driven anxiety remains unknown. Here, we assessed the serum biochemical parameters and behavioral performance by open field and Morris water maze tests in HFHS diet-induced MDs mice after OCA intervention for nine and 18 weeks. Moreover, antibiotics intervention for microbial depletion was conducted simultaneously. We found that OCA treatment inhibited the initiation and progression of anxiety in HFHS diet-MDs mice via a microbiota–BAs–brain axis: OCA decreased the neuroinflammatory microglia and IL-1β expression in the hippocampus, reversed intestinal barrier dysfunction and serum proinflammatory LPS to a normal level, modified the microbial community, including the known anxiety-related Rikenellaceae and Alistipes, and improved the microbial metabolites especially the increased BAs in feces and circulation. Moreover, the OCA-reversed bile acid taurocholate linked disordered serum lipid metabolites and indole derivatives to anxiety as assessed by network analysis. Additionally, microbial depletion with antibiotics also improved the anxiety, microgliosis and BAs enrichment in the experimental MDs mice. Together, these findings provide microbiota–BAs–brain axis as a novel therapeutic target for MDs-associated neuropsychiatric disorders.