In summary, these results provided the evidence that SAFP exerted a beneficial effect on a WIRS-induced gastric ulcer via blocking the TLR4 signaling pathway and activating the Nrf2 signaling pathway. This evidence concerns the gene TLR4 and gastric ulcer.