Gastric intestinal metaplasia (IM) is a precancerous lesion that is associated with an elevated risk of gastric carcinogenesis. Weiwei Decoction (WWD) is a promising traditional Chinese herbal formula widely employed in clinical for treating IM. Previous studies suggested the potential involvement of the olfactomedin 4 (OLFM4)/nucleotide-binding oligomerization domain 1 (NOD1)/caudal-type homeobox gene 2 (CDX2) signaling pathway in IM regulation. To verify the regulation of the OLFM4/NOD1/CDX2 pathway in IM, specifically investigating WWD's effectiveness on IM through this pathway. Immunohistochemistry for OLFM4, NOD1, and CDX2 was conducted on tissue microarray. GES-1 cells treated with chenodeoxycholic acid were utilized as IM cell models. OLFM4 short hairpin RNA (shRNA), NOD1 shRNA, and OLFM4 pcDNA were transfected to clarify the pathway regulatory relationships. Protein interactions were validated by co-immunoprecipitation. To explore WWD's pharmacological actions, IM rat models were induced using N-methyl-N'-nitro-N-nitrosoguanidine followed by WWD gavage. Gastric cells were treated with WWD-medicated serum. Cytokines and chemokines content were assessed by enzyme-linked immunosorbent assay and quantitative reverse transcription polymerase chain reaction. The OLFM4/NOD1/CDX2 axis was a characteristic of IM. OLFM4 exhibited direct binding and subsequent down-regulation of NOD1, thereby sustaining the activation of CDX2 and promoting the progression of IM. WWD improved gastric mucosal histological lesions while suppressing intestinal markers KLF transcription factor 4, villin 1, and MUCIN 2 expression in IM rats. Regarding pharmacological actions, WWD suppressed OLFM4 and restored NOD1 expression, consequently reducing CDX2 at the mRNA and protein levels in IM rats. Parallel regulatory mechanisms were observed at the protein level in IM cells treated with WWD-medicated serum. Furthermore, WWD-medicated serum treatment strengthened OLFM4 and NOD1 interaction. In case of anti-inflammatory, WWD restrained interleukin (IL)-6, interferon-gamma, IL-17, macrophage chemoattractant protein-1, macrophage inflammatory protein 1 alpha content in IM rat serum. WWD-medicated serum inhibited tumor necrosis factor alpha, IL-6, IL-8 transcriptions in IM cells. The OLFM4/NOD1/CDX2 pathway is involved in the regulation of IM. WWD exerts its therapeutic efficacy on IM through the pathway, additionally attenuating the inflammatory response.