An optimized compound 2 exhibited in vitro and in vivo anti-gastric cancer activity partly through inhibiting the AKT and STAT3 pathways, and displayed a favorable in vivo safety profile. Here, STAT3 is linked to gastric cancer.