The influence of antacids use on immune checkpoint inhibitor (ICI) efficacy remains unclear. A systematic review and meta-analysis was performed to evaluate the effect of proton pump inhibitors (PPIs) and histamine-2-receptor antagonists (H2RAs) on ICI efficacy in advanced solid cancer patients. A systematic literature search in PubMed, EMBASE, and Web of Science was performed to retrieve studies investigating the effect of antacid use on ICI efficacy. Overall survival (OS), progressionfree survival (PFS), objective response rate (ORR), and immunerelated adverse events were measured using hazard ratios (HRs) or odds ratios (ORs). Thirty studies enrolling 16,147 advanced cancer patients receiving ICI treatment were included. The pooled analysis indicated that PPI use was associated with shorter OS (HR = 1.40, 95% CI, 1.25-1.57) and PFS (HR = 1.34, 95% CI, 1.19-1.52) in advanced cancer patients treated with ICIs. PPI use did not show effect on ORR or immune-related adverse event of advanced cancer patients receiving ICI treatment. OS, PFS, and ORR did not differ between H2RA users and non-H2RA users. In subgroup analyses, PPI use was associated with shorter OS and PFS in NSCLC and urothelial carcinoma patients and in patients treated with anti-programmed cell death 1 or anti-programmed cell death ligand 1 monotherapy. In addition, ICI efficacy was different in the antacid exposure time frame subgroups. In conclusion, PPI use has a negative effect on OS and PFS among advanced cancer patients receiving ICI treatment. PPIs should be cautiously administered among advanced cancer patients treated with ICI. The safety of H2RAs and the influence of H2RAs on ICI efficacy need further investigation.