Weaning stress induces intestinal barrier dysfunction and immune dysregulation in mammals. Various interventions based on the modulation of intestinal microbiota have been proposed. Our study aims to explore the effects of co-cultures from Lactobacillus acidophilus and Bacillus subtilis (FAM®) on intestinal mucosal barrier from the perspective of metabolic function of gut microbiota. A total of 180 piglets were allocated to three groups, i.e., a control group (C, basal diet), a FAM group (F, basal diet supplemented with 0.1% FAM), and an antibiotic group (A, basal diet supplemented with antibiotic mixtures). Here, we showed FAM supplementation significantly increased body weight and reduced diarrhea incidence, accompanied by attenuated mucosal damage, increased levels of tight junction proteins, serum diamine oxidase (DAO) and antimicrobial peptides. In addition, 16S rRNA sequencing and metabolomic analysis revealed an increase in relative abundance of Clostridiales, Ruminococcaceae, Firmicutes and Muribaculaceae and a significant increase in the total short-chain fatty acids (SCFAs) and butyric acid in FAM-treated piglets. FAM also increased CD4+ T cells and SIgA+ cells in intestinal mucosa and SIgA production in colon contents. Furthermore, FAM upregulated the expression of IL-22, short-chain fatty acid receptors GPR43 and GPR41, aryl hydrocarbon receptor (AhR), and hypoxia-inducible factor 1α (HIF-1α). FAM shows great application prospect in gut health and provides a reference for infant weaning.