The question of whether variable risk factors and various nutrients are causally related to inflammatory bowel diseases (IBDs) has remained unanswered so far. Thus, this study investigated whether genetically predicted risk factors and nutrients play a function in the occurrence of inflammatory bowel diseases, including ulcerative colitis (UC), non-infective colitis (NIC), and Crohn’s disease (CD), using Mendelian randomization (MR) analysis. Utilizing the data of genome-wide association studies (GWASs) with 37 exposure factors, we ran Mendelian randomization analyses based on up to 458,109 participants. Univariable and multivariable MR analyses were conducted to determine causal risk factors for IBD diseases. Genetic predisposition to smoking and appendectomy as well as vegetable and fruit intake, breastfeeding, n-3 PUFAs, n-6 PUFAs, vitamin D, total cholesterol, whole-body fat mass, and physical activity were related to the risk of UC (p < 0.05). The effect of lifestyle behaviors on UC was attenuated after correcting for appendectomy. Genetically driven smoking, alcohol consumption, appendectomy, tonsillectomy, blood calcium, tea intake, autoimmune diseases, type 2 diabetes, cesarean delivery, vitamin D deficiency, and antibiotic exposure increased the risk of CD (p < 0.05), while vegetable and fruit intake, breastfeeding, physical activity, blood zinc, and n-3 PUFAs decreased the risk of CD (p < 0.05). Appendectomy, antibiotics, physical activity, blood zinc, n-3 PUFAs, and vegetable fruit intake remained significant predictors in multivariable MR (p < 0.05). Besides smoking, breastfeeding, alcoholic drinks, vegetable and fruit intake, vitamin D, appendectomy, and n-3 PUFAs were associated with NIC (p < 0.05). Smoking, alcoholic drinks, vegetable and fruit intake, vitamin D, appendectomy, and n-3 PUFAs remained significant predictors in multivariable MR (p < 0.05). Our results provide new and comprehensive evidence demonstrating that there are approving causal effects of various risk factors on IBDs. These findings also supply some suggestions for the treatment and prevention of these diseases.