Roux‐en‐Y gastric bypass surgery (RYGB) provides superior long‐term glycaemic control in severely obese and insulin resistant individuals. The improved peripheral insulin sensitivity at later stages after RYGB has been attributed in part to a reduction in intestinal permeability and associated endotoxemia, but the underlying mechanisms remain unclear. Here, we used diet‐induced obese rat and Caco2 cell monolayer models to show that RYGB region‐specifically strengthens intestinal epithelial barrier (IEB) integrity. This was partly farnesoid X receptor (FXR)‐dependent for the bile‐exposed duodenum and colon but not for the bile‐excluded jejunum. Transfer experiments performed on recipient germ‐free mice additionally demonstrated that jejunal and colonic but duodenal content of RYGB‐operated rats contain microbiota‐produced factors which improve oral glucose tolerance in proportion to suppression in endotoxemia. Collectively, these findings suggest that luminal primary and secondary bile acids acting through FXR in duodenal and colonic epithelial cells respectively, contribute to overall strengthening of IEB integrity and improved glucose homeostasis after RYGB and further support the use of bile acid mimetics for the treatment of metabolic disease.