Purpose To investigate the protective effect and mechanism of Krüppel-like factor 7 (KLF7) on retinal ganglion cells (RGCs) after optic nerve crush (ONC). Methods Ninety 10-week-old C57BL/6J mice were randomly assigned to five groups. The blank control group (group A), IVT (intravitreal injection) of KLF7 (group B), IVT of phosphate-buffered saline after ONC (group C), IVT of KLF7 after ONC (group D), and IVT of green fluorescent protein after ONC (group E). Retinal electroretinography and immunofluorescence staining were performed to observe the function and survival rate of RGCs on days 3 and 7 after ONC. The Western Blot determined the expressions of JNK 1, ERK, P38, NF-κB, IL-1, IL-6, and TNF-α seven days after ONC. Results After ONC, KLF7 gradually increased from day 3 to day 14, with the peak noted a peak on day 7. On day 7 after ONC, the RGC survival rate in Group D was significantly higher than in groups C ( P = 0.028) and E ( P = 0.007). The negative PhNR wave amplitude significantly decreased in groups C ( P = 0.03) and E ( P = 0.04) compared to group D. Moreover, group D also showed significantly higher ERK levels among the groups (all P < 0.01); NF-κB, IL-1, IL-6, and TNF-α expression decreased significantly in group D compared with groups C and E (all P < 0.01). Conclusions Overexpression of KLF7 improved the survival rate and function of RGCs in mice ONC models by activating the ERK pathway and inhibiting relevant inflammatory factors. KLF7 may be a promising protective factor against optic nerve damage.