This study aimed to explore biological pathways by which smoking may be involved in the pathogenesis of inflammatory bowel disease (IBD). We first conducted a prospective cohort study and a Mendelian randomization study to examine the association of smoking behaviors and related DNA methylation with Crohn’s disease (CD) and ulcerative colitis (UC) risks. If you are having problems running the codes, please do not hesitate to contact us.