Dandelion (Pugongying) is one of the most frequently used Chinese herbs for treating lactational mastitis (LM). Pugongying granules, a patented medication primarily comprised of dandelion extract, have been approved by CFDA for LM treatment in China. The aims of this study were to investigate the etiology of LM and the mechanism by which Pugongying granules decrease LM symptoms, with a particular focus on the microbial communities found in breastmilk.Participants were recruited from a previously performed randomized controlled trial (Identifier: NCT03756324, ClinicalTrials.gov). Between 2019 and 2020, women diagnosed with unilateral LM at the Beijing University of Chinese Medicine Third Affiliated Hospital were enrolled. In total, 42 paired breastmilk samples from the healthy and affected breasts of the participants were collected. Additionally, 37 paired pre- and post-treatment breastmilk samples from the affected breast were collected from women who received a 3-day course of either Pugongying granules (20 women) or cefdinir (17 women). Clinical outcomes [e.g., body temperature, visual analogue scale (VAS) score for breast pain, the percentage of neutrophils (NE%)] were analyzed pre- and post-treatment, and the breastmilk samples were subjected to 16S rRNA gene sequencing to analyze the alpha and beta diversities and identify significant bacteria. Finally, the relationship between microorganisms and clinical outcomes was analyzed.There was no significant difference in fever and pain between the Pugongying group and cefdinir group. The most prevalent bacterial genera in breastmilk were Streptococcus and Staphylococcus. Compared to healthy breastmilk, microbial diversity was reduced in affected breastmilk, and there was a higher relative abundance of Streptococcus. After Pugongying treatment, there was an increase in microbial diversity with significantly higher abundance of Corynebacterium. A negative correlation was found between Corynebacterium, VAS score, and NE%. Treatment with cefdinir did not affect microbial diversity. Taken together, our results show a correlation between LM and reduced microbial diversity, as well as an increased abundance of Streptococcus in affected breastmilk.Pugongying granules enhanced microbial diversity in breastmilk samples. Given the substantial variation in individual microbiomes, identifying specific species of Streptococcus and Corynebacterium associated with LM may provide additional insight into LM pathogenesis and treatment.