The richness of saproxylic species is commonly found to be compromised in managed forests. However, it is often less clear if this reflects local scarcity of high quality deadwood objects or changes to the overall forest structure. Further, anthropogenic and natural drivers working at the landscape scale may have a strong impact. Hence, it is difficult to give detailed advice on how to conserve biodiversity in a cost-effective manner. Here we explored macrofungal richness on deadwood across a gradient of forest management intensity in Danish Fagus sylvatica forests. We aimed to disentangle the importance of habitat quality per se from the effects of variables recorded at the forest stand and landscape scales. Data was collected from 40 beech stands, each representing one of four broad management types: conventionally managed, near-to-nature managed, recently unmanaged and long unmanaged. Stands were aggregated within six larger forest clusters, to account for variation at the landscape scale. Fungal species were recorded as fruitbodies on deadwood at five decay stages. We found that the four management types showed strong differences in fungal richness, deadwood volume and forest structure, with long unmanaged stands having notably higher structural complexity and species richness. Fungal species richness and presence of red-listed fungi appeared to be mainly driven by deadwood volume, tree species and decay stage, but some stand-level variables such as canopy gaps, basal area and stand age were also of importance. Lying coarse deadwood had the highest species richness while standing coarse woody debris and fine deadwood had lower species density. Saproxylic fungal richness on individual deadwood objects was largely affected by resource quality and size, which is often limited in managed forests. Our results indicate that the best measure to increase fungal species richness, especially in managed stands, is to increase the amount of large diameter deadwood.