Dietary diversity refers to the consumption of a variety of foods or food groups over a given reference period, which is crucial for improving nutrition and overall health. This longitudinal study aimed to investigate the association between dietary diversity and anthropometric indices in community-dwelling older adults living in Tehran in 2017 and 2021. The current study was conducted on 368 older adults [204 (55.4%) women and 164 (44.6%) men] over 60 years of age living in Tehran, who were selected by a systematic cluster sampling method at two-time points, 2017 and 2021. Anthropometric measures (weight, height, hip circumference, and waist circumference) were assessed with standard methods. The participants' dietary intake was assessed by completing two non-consecutive 24-hour recalls, and dietary diversity score (DDS) was calculated based on Kant's method. Statistical analysis was performed using R software by the mixed effect model method. The mean DDS of the participants in 2017 (5.07 ± 1.20) was higher than that in 2021 (4.94 ± 1.09) (p < 0.05). DDS and dairy diversity score decreased significantly over time. After adjusting for confounders, there was an inverse relationship between the DDS and Body Mass Index(BMI) (B = -0.22; SE = 0.09), but the interaction effect of year × DDS (B = 0.19; SE = 0.10) was not significant (p = 0.06). However, there was a positive relationship between the DDS and A Body Shape Index (ABSI) (B = 0.00; p = 0.022), after adjusting for confounders, this relationship was no longer significant. Additionally, the interaction effect of year and DDS on the ABSI was not significant. The dietary intake and dietary diversity of older adult residents of Tehran declined dramatically with age, and a higher DDS was associated with improved anthropometric indices. DDS had an inverse relationship with general obesity in the studied participants, and the passage of time did not affect this relationship. The DDS can be used as a predictive index and is a powerful tool for investigating changes in nutritional status in longitudinal studies of old age. However, longer-duration studies are needed to obtain more conclusive results.