The association between socioeconomic status (SES) and dietary diversity score (DDS) has been widely discussed, but little is known about the age and cohort effects on DDS and how the SES effect on DDS varies with age and across successive cohorts among urban and rural older adults in China. Thus, this study aimed to examine the temporal change in DDS among Chinese older adults and SES heterogeneities in such change from the perspective of urban–rural differentiation. Data from the Chinese Longitudinal Healthy Longevity Survey (CLHLS) between 2002 and 2018 were used, and a total of 13,728 participants aged between 65 and 105 years were included in this study. A total of eight food groups were used to assess DDS, while education, family income, and perceived income status were used to assess SES. A linear mixed model was used to estimate the age and cohort effects on DDS and their urban–rural and SES disparities. The results show that higher SES, including more education, family income, and perceived income status, was associated with higher DDS (for urban older adults, β = 0.1645, p = 0.0003, β = 0.2638, p < 0.0001, β = 0.2917, p < 0.0001, respectively; for rural older adults, β = 0.0932, p = 0.0080, β = 0.4063, p < 0.0001, β = 0.2921, p < 0.0001, respectively). The DDS of older adults increased with age and across successive cohorts in both urban and rural China. Moreover, we found the three-way interaction effect of SES, age, and cohort was statistically significant in both urban and rural China. Thus, living in an urban area and having higher SES are associated with higher DDS, but these associations change with age and across successive cohorts. The dietary health of earlier cohorts and rural oldest-old in China deserves more attention.