Agricultural expansion has markedly reduced forests and reconfigured landscapes. These changes incur a well‐known detrimental impact on the biodiversity of local forest patches, but the effects on species persistence in entire landscapes comprised of multiple patches are debated. Using data from ants collected in the Amazonian deforestation arc in Brazil, we investigated how regional diversity is affected by habitat loss, fragmentation, and cattle grazing, and how species respond to deforestation both locally and regionally. We also investigated how the heterogeneity in species distribution (beta‐diversity) buffers landscapes against local diversity losses. We used hierarchical multi‐species occupancy models to estimate these effects while controlling for errors in species detection. The vast majority of the 251 ant species found in our study were negatively affected by both habitat loss and cattle at local forest patches, drastically reducing diversity at these patches compared to continuous forests. Despite local declines in diversity, however, heavily fragmented landscapes could still retain most species due to the high heterogeneity in species distribution. We found that beta‐diversity is the main component of regional diversity. Results from several studies suggest that this component is maximized when remnant primary habitats in a landscape are spread across vast areas. Although preserving local diversity may be important for the adequate functioning of the ecosystem locally, our results indicate that the maintenance of many small forest patches in a landscape can buffer regional biodiversity against local species losses. Our results suggest that even small forest remnants in otherwise deforested landscapes can collectively prevent most regional‐scale species extirpations, and therefore also merit conservation efforts.