Aims Clostridium perfringens infections affect food safety, human health, and the development of the poultry feed industry. Anti-virulence is an alternative strategy to develop new drug. Perfringolysin O (PFO) is an exotoxin of C. perfringens that has been demonstrated to play critical roles in the pathogenesis of this organism, promising it an attractive target to explore drugs to combat C. perfringens infection. Methods and results Based on an activity-based screening, we identified six PFO inhibitors from the Food and Drug Administration (FDA)-approved drug library, among which rabeprazole sodium (RS) showed an optimal inhibitory effect with an IC50 of 1.82 ± 0.746 µg ml−1. The GLY57, ASP58, SER190, SER193-194, ASN199, GLU204, ASN377, THR379, and ALA200 in PFO interacted with RS during binding based on an energy analysis and H-bond analysis. This interaction blocked the oligomer formation of PFO, thereby inhibiting its cytotoxicity. RS treatment significantly increased the survival rate and alleviated pathological damage in C. perfringens or PFO-treated Galleria mellonella. Conclusions RS could potentially be used as a candidate drug for treating C. perfringens infection. [ABSTRACT FROM AUTHOR]