Wolfiporia cocos (F. A. Wolf) Ryvarden & Gilb, also known as Poria cocos is an ancient edible and medicinal mushroom that has been valued for thousands of years for its tranquilizing, diuretic, and spleen-enhancing properties. Because of the mushroom’s complex composition, its pharmacological effects have not been fully clarified. Therefore, to expand our knowledge of these effects from a pharmacological perspective and exploit potential medicinal value of fungal mushroom, we extracted three main metabolites from P. cocos, including water-soluble polysaccharides (PCX), water-insoluble polysaccharides (PCY), and triterpenoid saponins (PCZ) for intragastric injection into mice. These injections were made to explore the component’s effects on the mice’s gut microbiota and their metabolomics. The microbiota analysis showed that PCY had the strongest effect on regulating gut microbiota through altering its composition and increasing the number of Lactobacillus (p < 0.01). A total of 1,828 metabolites were detected using metabolomics methods, and the results showed that the three main active metabolites of P. cocos significantly changed the content of short-chain peptides in intestinal metabolites. In conclusion, our study further investigated the pharmacological functions of P. cocos, and revealed the differing effects of its three main metabolites on gut microbiota. The results suggested that PCY is a prominent prebiotic, and provided us with new insights into the potential development of fungal polysaccharides in Chinese traditional medicine.