Macrophage-driven immune dysfunction of the intestinal mucosa is involved in the pathophysiology of ulcerative colitis (UC). Emerging evidence indicates that there is an elevation in miR-31-5p levels in UC, which is accompanied by a downregulation of adenosine 5′-monophosphate (AMP)-activated protein kinase (AMPK) expression. Nevertheless, the precise influence of miR-31-5p on macrophage polarization and the integrity of the intestinal epithelial barrier in UC remains to be fully elucidated. This study explored the role of miR-31-5p and AMPK in UC through a bioinformatics investigation. It investigated the potential of miR-31-5p antagomir to shift macrophages from pro-inflammatory M1 phenotype to anti-inflammatory M2 phenotype and enhance the intestinal mucosal barrier in DSS-induced UC mice. Additionally, RAW264.7 cells stimulated with LPS were employed to confirm the reversal of miR-31-5p antagomir’s therapeutic effect under AMPK inhibition. The findings demonstrated that miR-31-5p antagomir penetrated colonic tissues and ameliorated DSS-induced experimental colitis. Transformation of spleen and mesenteric lymph node macrophages from M1 to M2 type was seen in the DSS+miR-31-5p antagomir group. AMPK/Sirt1 expression increased while NLRP3 expression decreased. Expression of M2-related genes and proteins was enhanced and that of the M1 phenotype suppressed. Tight junction proteins, ZO-1 and occludin, were increased. The therapeutic effects of miR-31-5p antagomir transfection into RAW264.7 cells were repressed when AMPK expression was inhibited. Therefore, our results suggest that suppression of miR-31-5p expression transformed macrophages from M1 to M2, ameliorated inflammation and repaired the intestinal epithelium to alleviate DSS-induced colitis. AMPK/Sirt1/NLRP3 was involved.