The animal gut microbiota is strongly influenced by environmental factors that shape their temporal dynamics. Although diet is recognized as a major driver of gut microbiota variation, dietary patterns have seldom been linked to gut microbiota dynamics in wild animals. Here, we analysed the gut microbiota variation between dry and rainy seasons across four Sceloporus species (S. aeneus, S. bicanthalis, S. grammicus and S. spinosus) from central Mexico in light of temporal changes in diet composition. The lizard microbiota was dominated by Firmicutes (now Bacillota) and Bacteroidota, and the closely related species S. aeneus and S. bicanthalis shared a great number of core bacterial taxa. We report species‐specific seasonal changes in gut microbiota diversity and composition: greater alpha diversity during the dry compared to the rainy season in S. bicanthalis, the opposite pattern in S. aeneus, and no seasonal differences in S. grammicus and S. spinosus. Our findings indicated a positive association between gut bacterial composition and dietary composition for S. bicanthalis and S. grammicus, but bacterial diversity did not increase linearly with dietary richness in any lizard species. In addition, seasonality affected bacterial composition, and microbial community similarity increased between S. aeneus and S. bicanthalis, as well as between S. grammicus and S. spinosus. Together, our results illustrate that seasonal variation and dietary composition play a role in shaping gut microbiota in lizard populations, but this is not a rule and other ecological factors influence microbiota variation.