Triptolide (TP), one of the main bioactive diterpenes of the herbal medicine Tripterygium wilfordii Hook F, is used for the treatment of autoimmune diseases in the clinic and is accompanied by severe hepatotoxicity. CYP3A4 has been reported to be responsible for TP metabolism, but the mechanism remains unclear. The present study applied a UPLC–QTOF–MS‐based metabolomics analysis to characterize the effect of CYP3A4 on TP‐induced hepatotoxicity. The metabolites carnitines, lysophosphatidylcholines (LPCs) and a serious of amino acids were found to be closely related to liver damage indexes in TP‐treated female mice. Metabolomics analysis further revealed that the CYP3A4 inducer dexamethasone improved the level of LPCs and amino acids, and defended against oxidative stress. On the contrary, pretreatment with the CYP3A4 inhibitor ketoconazole increased liver damage with most metabolites being markedly altered, especially carnitines. Among these metabolites, except for LPC18:2, LPC20:1 and arginine, dexamethasone and ketoconazole both affected oxidative stress induced by TP. The current study provides new mechanistic insights into the metabolic alterations, leading to understanding of the role of CYP3A4 in hepatotoxicity induced by TP.