The continuous changes and increase of land use into ranching and agriculture have caused shifts in the composition and structure of dung beetle communities due to the modification of vegetation structure. The impact of these changes can be approached using dung beetles as ecological indicators. Agricultural, ranching, and forestry are often integrated into the same farm in different proportions (landscape level), and their degree of integration with habitats changes over time and space. We assessed if different habitat proportions of crop, pasture, and forest land on three farms affect the structure and diversity of dung beetle (Coleoptera: Scarabaeinae) communities. Farms included from three to four habitat conditions each (plantations of timber species, banana-coffee plantation, living fences, pastures, secondary and riparian forest). Pitfall traps with dung and carrion as bait were placed across each habitat condition of each farm during three different sampling periods. Across all samplings, 1,198 dung beetle individuals belonging to 21 species were captured. Species diversity and composition vary according to the type of farm and the main factor that modifies this tendency is the proportion of pasture land composing the farm. Farms with a lower proportion of grazing land (11.96% for forestry farms and 32.19% for agricultural farms) and denser vegetation canopy, which cast more shadows, had greater beetle diversity. Conversely, farms having a greater proportion of grazing land had low diversity and a dominant tendency in the species abundance curve. Umbraphile species dominated the forest farm, indicating a strong affinity for shaded environments such as the one provided there, while species displaying no habitat preference exhibited higher abundance in the ranching farm. Additionally, a notable prevalence of small-sized species was observed in the ranching farm, contrasting with a relatively even distribution of sizes in the remaining landscapes. These tendencies suggest that shade positively influences biodiversity conservation. Riparian vegetation, living fences, and banana-coffee plantations are important connectivity elements in agricultural landscapes for shade-adapted dung beetle species.