Context Our previous studies have found that total flavonoid of Alpinia officinarum Hance (Zingiberaceae) (F.AOH) had protective effects on gastric ulcer (GU). Objective To investigate the protective mechanism of F.AOH on acetic acid-induced chronic GUs in rats and ethanol-induced GES-1 cells damage. Materials and methods In vivo: Gastric damage was induced in SD rats by administering acetic acid after oral treatment with F-AOH at 54, 27 and 13.5 mg/kg (2 weeks of continuous gavage). After a comprehensive evaluation of rats’ serum and gastric tissue-related indicators, gene transcriptome sequencing, qPCR and Western blotting were used to investigate the mechanism further. In vivo: GES-1 cells were incubated with F-AOH (8, 4 and 2 μg/mL) for 16 h and treated with 7% ethanol for 4 h. Transwell and flow cytometry were employed to detect migration and apoptosis of cells. Results F.AOH effectively reduced the area of GUs in rats (from 11.2 ± 1.89 to 2.19 ± 0.95), reversing ethanol-induced cells apoptosis (from 23 ± 1.3 to 8.11 ± 0.93%). It also inhibited the expression of endothelin-1 (ET-1) and iNOS proteins, decreasing the levels of TNF-α IL-6 in serum, improving oxidative stress levels and increasing the expression of Bcl-2/Bax dimer genes. In addition, 4005 differentially expressed genes between the acetic acid model and the drug groups. Through experimental verification, F.AOH can inhibit the activation of TLR4/NF-κB signalling pathway and TRPV1 receptor. Conclusions F.AOH, as an effective gastric protective plant component, had potential therapeutic value in anti-inflammatory pain and antioxidative stress gastrointestinal diseases.