AIM: Antihyperglycemic drugs have potential therapeutic benefits for inflammatory bowel disease (IBD). We aimed to investigate the association between genetic variations in gene-targeted antihyperglycemic drugs and the risk of IBD. METHODS: Summary statistics for HbA1c data were from the UK Biobank including 344,182 participants. Statistics of IBD were obtained from UK Inflammatory Bowel Disease Genetics. Two Mendelian randomization methods were employed to derive the main findings. RESULTS: In the SMR analysis, increased expression of genetic variations in SGLT2 inhibitor targets (gene: SLC5A2) was linked to a higher risk of CD (OR: 1.97, P = 0.048). Genetic variation in brain cerebellum tissue of sulfonylurea targets (gene: ABCC8) expression was positively associated with IBD (OR = 1.11, P = 0.000). The genetic variation in the GLP-1RA targets (gene: GLP1R) expression was positively correlated with IBD (OR: 1.45, P = 0.039). The IVW-MR analysis suggested reduced IBD and CD risk with expression of increased genetic variation in the thiazolidinediones targets (gene: PPARG). CONCLUSION: Genetic variations in SGLT2 inhibitor targets might be associated with an increased risk of CD. The ABCC8 gene might be linked to IBD, CD, and UC. There might be a positive correlation between genetic variation in the GLP-1RA targets expression and IBD occurrence.