Sustainable agriculture is essential to address global challenges such as climate change and biodiversity loss. Hedgerows enhance aboveground biodiversity and provide ecosystem services, but little is known about their impact on soil biota. Arbuscular mycorrhizal (AM) fungi are one of the key components of belowground biodiversity. We compared the diversity and composition of AM fungal communities in four farmland sites located in Central Spain, where 120 samples in total were collected to assess soil physical and chemical properties and analyse AM fungal metabarcode data. We compared the richness (number of AM fungal taxa), abundance (number of sequences), taxonomic, functional, and phylogenetic diversity, and composition of AM fungal communities across three farmland habitat types, namely hedgerows, woody crops (olive groves and vineyard) and an herbaceous (barley) crop. Our results showed positive effects of hedgerows on most diversity metrics. Many AM fungal taxa were shared among the three farmland habitat types. Planting hedgerows increased AM fungal richness (F2,112 = 23.21, P < 0.01) and alpha diversity (F2,112= 11.62, P < 0.01), especially in herbaceous crops. Hedgerows and woody crops harboured more AM fungal sequences than herbaceous crops (F2,112 = 15.10, P < 0.01). Hedgerows exhibited higher proportions of AM fungi with non-ruderal life-history strategies (F2,112 = 11.08, P < 0.01). AM fungi communities were more similar in hedgerows and woody crops (F2,112 = 3.93, P < 0.01) than in hedgerows and herbaceous crops due to lack of tillage in hedgerows and woody crops. Unexpectedly, planting hedgerows reduced phylogenetic diversity, which might be related to random processes shaping communities in crops. Overall, the observed results hint that planting hedgerows contributes to restoring belowground diversity. Thus, European farmers should plant more hedgerows to attain the goals of the EU Biodiversity Strategy for 2030.