We investigated the effect of triptolide (TP) on spinal cord injury (SCI), and its underlying mechanism. Following the establishment of the SCI model using YFP H‐line transgenic mice, TP was intraperitoneally injected at a dose of 0.2 mg/kg once daily for 7 days. Behavioral tests, Nissl staining, and hematoxylin–eosin staining were employed to assess motor function recovery and neuronal cell death. Western blot and immunofluorescence staining were used to assess autophagy‐associated proteins (LC3B, p62, Beclin‐1) and the apoptosis‐associated proteins (Bcl‐2, caspase‐3, Bax). The TP‐treated group showed improved motor functions, and reduced neuronal cell death. Also, significant upregulation of Bcl‐2 and LC3B expressions, with the downregulation of p62, Bax and caspase‐3 expressions were found in the TP‐treated group. Additionally, phosphorylation of extracellular signal‐regulated protein kinases 1 and 2 (ERK1 and ERK2) was decreased in the TP‐treated group. TP mediates its protective effect in SCI by promoting the autophagic pathway while inhibiting the MAPK/ERK1/2 signaling pathway. These results demonstrate the therapeutic potential of TP in SCI.