Immunosuppression mediated by CD4 + T cell apoptosis and dysfunction is a key factor in promoting the progression of sepsis. Endoplasmic reticulum (ER) stress participates in the apoptosis and dysfunction of immune cells. We aimed to investigate the role of ER stress inhibition in CD4 + T cells in both in vitro and in vivo models of sepsis. In vitro model of sepsis was established with lipopolysaccharide (LPS) and the rat model of sepsis was established using cecal ligation and puncture (CLP). After the LPS treatment or CLP, ER stress inhibitors including 4-PBA, SNJ-1945, and SP600125 were used to treat cells or rats, and the CD4 + T cells were obtained by magnetic bead sorting. The effects of ER stress inhibitors on apoptosis and the function of CD4 + T cells were evaluated. After the LPS stimulation or CLP, the levels of ER stress and downstream markers (PERK, eIF2α, IRE-1α, ATF6, ATF4, XBP-1 s, GRP78, CHOP, and p-JNK) were increased in CD4 + T cells at the beginning of sepsis. Meanwhile, the number of apoptotic CD4 + T cells markedly increased. In addition, sepsis impaired the function of CD4 + T cells, manifested by the increased population of Th1, Th2, Th17, and Treg, as well as the production of TNF-α, interleukin (IL)-6, IL-4, and IL-10. However, inhibitors of ER stress, JNK, and calpain all decreased the induction of Th1 and Th17, enhanced the increase of Th2 and Treg, decreased the production of TNF-α and IL-6, and enhanced the production of IL-4 and IL-10. Our findings indicate that ER stress inhibitors may play a protective role by reducing CD4 + T cell apoptosis and maintaining CD4 + T cell function, which may be useful for enhancing the immune function and poor prognosis of patients with sepsis.