Accumulating evidence links m6A modification with immune infiltration. However, the correlation and mechanism by which m6A modification promotes intestinal immune infiltration in inflammatory bowel disease (IBD) is unknown. Here, genomic information from IBD tissues was integrated to evaluate disease-related m6A modification, and the correlation between the m6A modification pattern and the immune microenvironment in the intestinal mucosa was explored. Next, we identified hub genes from the key modules of the m6Acluster and analyzed the correlation among the hub genes, immune infiltration, and therapy. We found that IGF2BP1 and IGF2BP2 expression was decreased in Crohn’s disease (CD) tissues and that IGF2BP2 was decreased in ulcerative colitis (UC) tissues compared with normal tissues (P < 0.05). m6Acluster2, containing higher expressions of IL15, IL16, and IL18, was enriched in M0 macrophage, M1 macrophage, native B cells, memory B cells, and m6Acluster1 with high expression of IL8 and was enriched in resting dendritic and plasma cells (P < 0.05). Furthermore, we reveal that expression of m6A phenotype-related hub genes (i.e., NUP37, SNRPG, H2AFZ) was increased with a high abundance of M1 macrophages, M0 macrophages, and naive B cells in IBD (P < 0.01). Immune checkpoint expression in the genecluster1 with higher expression of hub genes was increased. The anti-TNF therapeutic response of patients in genecluster1 was more significant, and the therapeutic effect of CD was better than that of UC. These findings indicate that m6A modification may affect immune infiltration and therapeutic response in IBD. Assessing the expression of m6A phenotype-related hub genes might guide the choice of IBD drugs and improve the prediction of therapeutic response to anti-TNF therapy.