The purpose of this paper is to explore the relationship between subjective well-being, social class identity, and Self-rated health among older persons,. Focusing on the mediating role of health and the impact of epidemic infectious diseases on these relationships. Based on the 2018 and 2021 China General Social Survey (CGSS) databases, the data were screened, and processed. Using Stata17, we employed ordered probit regression to examine the relationships among variables and Bootstrap methods to assess mediation effects, and the CGSS data for 2018 and 2021 were compared and analyzed. Our results revealed that factors such as social class identity, health status, and personal income significantly positively impact older persons' subjective well-being (P<0.01). Notably, there was a partial mediating effect of health status between the subjective well-being of the elderly and social class identity. And findings showed that when older adults were affected by epidemic diseases, their subjective well-being, social class identity, and Self-rated health remained significantly positively correlated. Subjective well-being, social class identity. What is more noteworthy is that when affected by epidemic infectious diseases, older adults' subjective well-being, social class identity, and Self-rated health remained significantly positively correlated. The mediating role of self-rated health in older adults' subjective well-being and social class identity increased from 9.6% to 12.4%. In the face of epidemic infectious diseases, we need to pay more attention to the Self-rated health of the elderly, and the Chinese government should take effective measures to improve their health level, which will in turn improve the subjective well-being of the elderly and realize the goal of healthy aging.