BackgroundThe plant secondary metabolites (PSMs), as important plant resistance indicators, are important targets for screening plant insect resistance breeding. In this study, we aimed to investigate whether the population of Zeuzera coffeae (ZC) is affected by different varieties of Carya illinoinensis PSMs content. At the same time, the structure and function of the gut microbiome of ZC were also analyzed in relation to different pecan varieties.MethodsWe counted the populations of ZC larvae in four pecan varieties and determined the content of four types of PSMs. The structure and function of the larval gut microbiota were studied in connection to the number of larvae and the content of PSMs. The relationships were investigated between larval number, larval gut microbiota, and PSM content.ResultsWe found that the tannins, total phenolics, and total saponins of 4 various pecans PSMs stifled the development of the ZC larval population. The PSMs can significantly affect the diversity and abundance of the larval gut microbiota. Enrichment of ASV46 (Pararhizobium sp.), ASV994 (Olivibacter sp.), ASV743 (Rhizobium sp.), ASV709 (Rhizobium sp.), ASV671 (Luteolibacter sp.), ASV599 (Agrobacterium sp.), ASV575 (Microbacterium sp.), and ASV27 (Rhizobium sp.) in the gut of larvae fed on high-resistance cultivars was positively associated with their tannin, total saponin, and total phenolic content. The results of the gut microbiome functional prediction for larvae fed highly resistant pecan varieties showed that the enriched pathways in the gut were related to the breakdown of hazardous chemicals.ConclusionOur findings provide further evidence that pecan PSMs influence the structure and function of the gut microbiota, which in turn affects the population stability of ZC. The study’s findings can serve as a theoretical foundation for further work on selecting ZC-resistant cultivars and developing green management technology for ZC.