The aim of this study was to investigate the potential protective effects of walnut oligopeptides (WOPs) on indomethacin-induced gastric ulcers in rats. The rats were divided into the following groups: normal group, model group, omeprazole group (0.02 g/kg), and WOPs groups (0.22, 0.44, and 0.88 g/kg, respectively). After receiving gavage once per day for 30 consecutive days, the rats were injected intraperitoneally with indomethacin 48 mg/kg to induce gastric ulcers. Then, the serum inflammatory cytokines and gastric prostaglandin E2 (PGE2), oxidative stress-related indicators, and the RNA expression of COX-1 and COX-2 were measured. The results revealed that WOPs confer significant gastroprotection on gastric ulcers caused by indomethacin, regulating inflammatory cytokines, oxidative stress, and prostaglandins synthesis, and enhancing the expression of COX-1 and COX-2 in gastric tissue, thus exerting its protective effect on gastric mucosa. The gastroprotective mechanism may be related to the involvement of the arachidonic acid metabolism and upregulation of tryptophan, phenylalanine, tyrosine, and alpha-Linolenic acid metabolism synthesis in vivo.