To explore the feasibility of dietary Chinese herbal residue (CHR) supplementation in swine production with the objective of valorization, we examined the effects of dietary supplementation with CHR or fermented CHR products on the colonic ecosystem (i.e., microbiota composition, luminal bacterial metabolites, and expression of genes related to the intestinal barrier function in weaned piglets). We randomly assigned 120 piglets to one of four dietary treatment groups: a blank control group, CHR group (dose of supplement 4 kg/t), fermented CHR group (dose of supplement 4 kg/t), and a positive control group (supplemented with 0.04 kg/t virginiamycin, 0.2 kg/t colistin, and 3000 mg/kg zinc 0.04 kg/t virginiamycin, 0.2 kg/t colistin, and 3000 mg/kg zinc oxide). Our results indicate that dietary supplementation with CHR increased (P < 0.05) the mRNA level corresponding to E-cadherin compared with that observed in the other three groups, increased (P < 0.05) the mRNA level corresponding to zonula occludens-1, and decreased (P < 0.05) the quantity of Bifidobacterium spp. When compared with the blank control group. Dietary supplementation with fermented CHR decreased (P < 0.05) the concentration of indole when compared to the positive control group; increased (P < 0.05) the concentrations of short-chain fatty acids compared with the values measured in the CHR group, as well as the mRNA levels corresponding to interleukin 1 alpha, interleukin 2, and tumor necrosis factor alpha. However, supplementation with fermented CHR decreased (P < 0.05) interleukin 12 levels when compared with the blank control group. Collectively, these findings suggest that dietary supplementation with CHR or fermented CHR modifies the gut environment of weaned piglets.