Dry grasslands are of great interest for nature conservation in Europe, because they have a central role in the conservation of numerous rare and endangered species. In this study carried out in the Brenta mountain group (Italian alps), we investigated the effect of environmental factors mainly controlled by topography, on the biodiversity trends across different dry grassland habitats where the threatened alpine stenoendemic Erysimum aurantiacum grows. Plant community data and ecological factors were analysed by means of a multi‐habitat CCA approach and by analysis of biodiversity gradients in 7 natural and semi‐natural habitats. We found that species turnover and biodiversity patterns vary as a function of multi‐factorial ecological gradients. For the single habitats, elevation gradient was the main factor explaining compositional variation, followed by inclination and proportion of exposed rock surface. Despite its endangered status, E. aurantiacum showed a relatively high degree of ecological plasticity across these semiarid grassland habitats that probably allows it to survive in different environments, including in some cases those impacted by human activities. This prompts for habitat‐ more than species‐level conservation actions. According to their characteristics and threats, habitat‐specific management practices are recommended for long term conservation of plant species communities in the different ecological niches.