Plant and soil elemental ratios of carbon (C), nitrogen (N) and phosphorus (P) play a central role in shaping the composition and structure of microbial communities. However, the relationships between plant and soil elemental C:N:P ratios and microbial diversity are still poorly understood. Here, we evaluated the effects of C:N:P ratios in plant-soil systems on microbial diversity in a chronosequence of restored grasslands (1, 5, 10, 15, 25, and 30 years since restoration) on the Loess Plateau. We found that C and N concentrations, C:N and C:P ratios in leaf, root, soil and microbial biomass, bacterial and fungal diversity (Shannon-Wiener index) gradually increased with year since grassland restoration. Microbial C:N:P ratios ranged from 17.8:4.5:1 to 24.3:6.6:1, and C:P ratio increased from 17.8:1 at the 1-year site to 24.3:1 at the 30-year site, indicating the increasing P limitation for soil microorganisms during grassland development. Soil microbial diversity increased with root, soil, and microbial C and N concentrations, and decreased with P concentration (p < 0.05). Structural equation modeling indicated that soil and microbial C:N and N:P ratios had the greatest influences on soil bacterial and fungal diversity, and elemental C:N:P ratios had a greater effect on soil fungal than bacterial diversity. Our findings emphasize the importance of elemental C:N:P ratios on soil microbial diversity, which is critical for formulating policies for sustainable biodiversity conservation in terrestrial ecosystems. © 2021