Research into the effects of plantations, arbuscular mycorrhizal fungi (AMF) inoculation and their interplay on soil microbial communities has emerged as a pivotal focus in the restoration of mining areas. This study investigated how AMF inoculation, plantation density and their interaction shaped bacterial communities in a mining region in Northwest China. A field experiment was conducted with three plantation densities, both with and without AMF inoculation. Soil physicochemical properties, understory vegetation composition, extracellular enzyme activities, as well as soil bacterial and functional communities, were comprehensively analysed. The two‐way ANOVA results revealed significant influences of plantation density and AMF inoculation on the understory vegetation community, soil properties, bacterial communities, and their functional traits (p < .05). Higher planting densities and increased AMF biomass notably elevated soil carbon and nitrogen levels, litter inputs and the clay and silt content of the soil (p < .05). Across all samples, phosphorus limitation was evident in soil microbial activity, as indicated by a vector angle exceeding 45°. Mantel analysis further identified soil carbon and phosphorus as key determinants shaping bacterial communities (Mantel's p < .05). Importantly, AMF inoculation exerted a more pronounced impact on bacterial functional traits compared to plantation density (p < .05). In addition, the intermediate planting density in inoculated treatments yielded the highest available phosphorus, microbial biomass phosphorus and understory vegetation biomass, as well as the lowest microbial phosphorus limitation. Therefore, our study, which provided a comprehensive analysis of the influence of planting density and AMF inoculation on soil and bacterial communities, recommended intermediate planting density and AMF inoculation for optimal results.