Intestinal dysbiosis has been widely documented in inflammatory bowel diseases (IBDs) and is thought to influence the onset and perpetuation of gut inflammation. However, it remains unclear whether such bacterial changes rely in part on the modification of an IBD-associated lifestyle (e.g., smoking and physical activity) and diet (e.g., rich in dairy products, cereals, meat and vegetables). In this study, we investigated the impact of these habits, which we defined as confounders and covariates, on the modulation of intestinal taxa abundance and diversity in IBD patients. 16S rRNA gene sequence analysis was performed using genomic DNA extracted from the faecal samples of 52 patients with Crohn’s disease (CD) and 58 with ulcerative colitis (UC), which are the two main types of IBD, as well as 42 healthy controls (HC). A reduced microbial diversity was documented in the IBD patients compared with the HC. Moreover, we identified specific confounders and covariates that influenced the association between some bacterial taxa and disease extent (in UC patients) or behaviour (in CD patients) compared with the HC. In particular, a PERMANOVA stepwise regression identified the variables “age”, “eat yogurt at least four days per week” and “eat dairy products at least 4 days per week” as covariates when comparing the HC and patients affected by ulcerative proctitis (E1), left-sided UC (distal UC) (E2) and extensive UC (pancolitis) (E3). Instead, the variables “age”, “gender”, “eat meat at least four days per week” and “eat bread at least 4 days per week” were considered as covariates when comparing the HC with the CD patients affected by non-stricturing, non-penetrating (B1), stricturing (B2) and penetrating (B3) diseases. Considering such variables, our analysis indicated that the UC extent differentially modulated the abundance of the Bifidobacteriaceae, Rikenellaceae, Christensenellaceae, Marinifilaceae, Desulfovibrionaceae, Lactobacillaceae, Streptococcaceae and Peptostreptococcaceae families, while the CD behaviour influenced the abundance of Christensenellaceae, Marinifilaceae, Rikenellaceae, Ruminococcaceae, Barnesiellaceae and Coriobacteriaceae families. In conclusion, our study indicated that some covariates and confounders related to an IBD-associated lifestyle and dietary habits influenced the intestinal taxa diversity and relative abundance in the CD and UC patients compared with the HC. Indeed, such variables should be identified and excluded from the analysis to characterize the bacterial families whose abundance is directly modulated by IBD status, as well as disease extent or behaviour.