In the treatment of spinal cord injury (SCI), the complex process of secondary injury is mainly responsible for preventing SCI repair or even exacerbating the injury. In this experiment, we constructed the 8-gingerol (8G)-loaded mesoporous polydopamine (M-PDA), M@8G, as the in vivo targeting nano-delivery platform, and investigated the therapeutic effects of M@8G in secondary SCI and its related mechanisms. The results indicated that M@8G could penetrate the blood-spinal cord barrier to enrich the spinal cord injury site. Mechanism research has shown that all of the M-PDA,8G and M@8G displayed the anti-lipid peroxidation effect, and then M@8G can inhibit the secondary SCI by suppressing the ferroptosis and inflammation. In vivo assays showed that M@8G significantly diminished the local injury area, reduced axonal and myelin loss, thus improving the neurological and motor recovery in rats. Based on the analysis of cerebrospinal fluid samples from patients, ferroptosis occurred locally in SCI and continued to progress in patients during the acute phase of SCI as well as the stage after their clinical surgery. This study showcases effective treatment of SCI through the aggregation and synergistic effect of M@8G in focal areas, providing a safe and promising strategy for the clinical treatment of SCI.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12951-023-01896-1.