Objective To explore the mechanism of Wenpi Zhixie Capsules for the treatment of diarrhea⁃predominant irritable bowel syndrome (IBS) based on the regulation of macrophage polarization and Th17/Treg homeostasis. Methods A total of 18 rats were assigned to control group, model group, positive drug group, and low⁃, medium⁃, and high⁃dose Wenpi Zhixie Capsules groups, with 3 rats in each group. Diarrhea⁃predominant IBS model was constructed by acquiring rats of the model group and various drug groups. After successful modeling, rats in the positive drug group received intragastric administration of 13.5 mg/kg pinaverium bromide, whereas rats in the low⁃, medium⁃, and high⁃dose Wenpi Zhixie Capsules groups received intragastric administration of Wenpi Zhixie Capsules in 95 mg/kg, 190 mg/kg, and 380 mg/kg, respectively, and the remaining two groups received intragastric administration of normal saline. After two weeks, colon transport experiment, fecal character score, abdominal withdrawal reflex (AWR) score were conducted. Colon tissues of rats in various groups were obtained, pathological changes of colon tissues were observed. Macrophage polarization was evaluated through detecting inducible nitric oxide synthase (iNOS) and CD206 expressions, and interleukin (IL)⁃6, IL⁃10, IL⁃17, and IL⁃23 expressions were also detected. Results (1) Compared with the control group, AWR score increased in the model group; moreover, compared with the model group, the AWR score in the positive drug group and the medium⁃ and high⁃dose Wenpi Zhixie Capsules groups decreased (P<0.05). (2) Compared with the model group, rats in various drug groups exhibited basically intact colon tissues, and significantly reduced inflammatory cells in the mucosal layer. (3) Compared with the control group, iNOS expression elevated while CD206 expression decreased in colon tissues of the model group; furthermore, compared with the model group, iNOS expression decreased while CD206 expression elevated in colon tissues of various drug groups (P<0.05). (4) The model group exhibited elevated IL⁃6, IL⁃17, IL⁃23 expressions while decreased IL⁃10 expression as compared with the control group, whereas IL⁃6 expression in colon tissues of the positive drug group, IL⁃17 expression in colon tissues of the positive drug and medium⁃dose Wenpi Zhixie Capsules groups, IL⁃23 expression in colon tissues of the positive drug group, medium⁃ and high⁃dose Wenpi Zhixie Capsules groups all decreased, while IL⁃10 expression in colon tissues of the positive drug and high⁃dose Wenpi Zhixie Capsules groups elevated as compared with the model group (P<0.05). (5) There was no statistically significant difference in colon transport experiment, fecal character score, AWR score, iNOS and CD206 expressions in colon tissues between Wenpi Zhixie Capsules in different doses groups (P>0.05). The effect of medium⁃ and high⁃dose Wenpi Zhixie Capsules was superior to low⁃dose Wenpi Zhixie Capsules in improving the pathological damage of colon tissues. Compared with the low⁃dose Wenpi Zhixie Capsules group, the expressions of IL⁃17 and IL⁃23 in colon tissues of the medium⁃dose Wenpi Zhixie Capsules group decreased, and IL⁃23 expression decreased in colon tissues of the high⁃dose Wenpi Zhixie Capsules group, while IL⁃10 expression elevated in colon tissues of the high⁃dose Wenpi Zhixie Capsules group (P<0.05). Conclusion Wenpi Zhixie Capsules exert favorable therapeutic effect on diarrhea⁃predominant IBS, it may exert effect through promoting macrophage polarization in M2 type, and regulating Th17/Treg homeostasis.