Livestock is a globally widespread farming practice, with benefits and harms for biodiversity. Biodiversity responses to vegetation and soil conditions associated with cattle grazing removal are poorly understood in tropical grassy ecosystems, especially in a long‐term chronosequence. In this study, we aimed to identify the main drivers of local conditions on dung beetle taxonomic and functional diversity across a chronosequence of natural grasslands with different cattle grazing removal ages. We expect that vegetation and soil variables associated with environmental changes caused by longer time after cattle grazing removal will drive the taxonomic and functional diversity of dung beetles. We sampled dung beetles and recorded local environmental filters (vegetation and soil variables) in 14 natural grasslands with distinct cattle grazing removal ages (from 3 months to 22 years) and also in 10 reference sites (with cattle grazing). We used structural equation models to evaluate the relationships between the most informative explanations (vegetation and soil variables) of dung beetle taxonomic and functional metrics. Our results provide evidences that local conditions related to vegetation and soil variables in natural grasslands affect the taxonomic and functional diversity of dung beetles differently. Soil conditions (compaction and silt content) had more influence, mostly negative, on taxonomic metrics, while vegetation complexity had more influence on functional metrics, with positive or negative effects depending on the functional metric evaluated. Understanding the temporal change in vegetation and soil conditions can shed light on the process of recovering biodiversity and ecosystem functions in areas with different times of abandonment of livestock farming. Finally, using taxonomic and functional approaches together can also help to better understand how organisms are responding to the process of abandoning livestock farming over time. [ABSTRACT FROM AUTHOR]