Abstract The objective of this study was to investigate the fecal microbiota of weaned pigs when supplemented with different botanical blends while being experimentally infected with a pathogenic E. coli. A total of 60 weaned pigs (7.17 ± 0.97 kg) were individually housed and randomly assigned to 1 of the 5 treatments (12 pigs/treatment): sham control (CON-), challenged control (CON+), challenged botanical blend 1 with 100 ppm (BB1_100), challenged BB2 with 50 ppm (BB2_50), and challenged BB2 with 100 ppm (BB2_100). Both botanical blends were composed of capsicum oleoresin but different garlic extract varieties. The experiment lasted for 28 d including a 7-d habituation period followed by an E. coli oral inoculation of 1010 CFU/dose for 3 consecutive days. Fecal samples were collected on d -7, 0, 5 and 21 post inoculation (PI) to perform 16S rRNA sequencing at the V4 hypervariable region. Downstream analysis was performed using QIIME2 (v. 2020.8) and R. No difference was observed among treatments throughout the experiment in alpha diversity. Bray-Curtis PCoA displayed pronounced clusters by days but also displayed overlaps when looking into day and treatment interaction. Firmicutes was more (P < 0.05) abundant in CON- than the botanical treatments while Bacteroidetes and Proteobacteria were more (P < 0.05) abundant in BB1_100 and BB2_50 than in CON- on d 5 PI. Firmicutes was less (P < 0.05) abundant in BB2_50 and Proteobacteria was more (P < 0.05) abundant in BB1_100 than in CON+ on d 21 PI. Lachnospiraceae was less abundant (P < 0.05) in BB2_50 than in CON- on d 5 PI and less (P < 0.05) abundant in BB1_100 than in CON- on d 21. In conclusion, the botanical treatments have modified the fecal microbiota of weaned pigs challenged with an enteropathogenic E. coli.