Sequestering farmland for secondary succession is an effective method of restoring ecosystem services to degraded farmland, but long-term secondary succession often alters ecosystem environments, resources, and substrate stoichiometry. Currently, it is not known how resource changes and stoichiometric imbalances due to secondary succession affect soil microbial community structure and function, hindering our understanding of the natural resilience for degraded ecosystems. Here, we assessed nutrient limitation elements, community structure, metabolic functions, co-occurrence network complexity, and community stability of soil microorganisms during secondary succession of abandoned farmlands on the Loess Plateau. Results showed that secondary succession significantly altered plant characteristics and soil properties, as well as causing stoichiometry imbalances in nutrient resources. Along the secondary succession chronosequence, microbial nutrient metabolism shifted from phosphorus (P) limitation to carbon (C) and nitrogen (N) co-limitation. Microbial diversity, eutrophic flora, plant growth-promoting bacteria, and metabolism functional groups increased significantly during the 20 years after the abandonment of the farmlands, but decreased significantly with long-term succession. However, oligotrophic flora and P-solubilizing bacteria became dominant after 30 years of secondary succession on abandoned farmlands. The topological features of microbial co-occurring networks, including nodes, degree, closeness, betweenness, and eigenvector complexity, natural connectivity, and community stability first increased and then decreased with secondary succession. Correlation and random forest analyses indicated that secondary succession-induced stoichiometry imbalances in C:N and N:P, as well as changes in soil organic C and lignin phenols, were the key factors influencing microbial community structure and function. Overall, these results enhance our understanding of the adaptation strategies of soil microbial communities in ecologically managed regions to changes in ecosystem resources and stoichiometric imbalances.