Helicobacter pylori infection was associated with the expression of KLF4 and 5hmC in gastric cancer tissues. Here, KLF4 is linked to gastric cancer.