1. Ecosystem functioning may directly or indirectly-via change in biodiversityrespond to land use. Dung removal is an important ecosystem function central for the decomposition of mammal faeces, including secondary seed dispersal and improved soil quality. Removal usually increases with dung beetle diversity and biomass. In forests, dung removal can vary with structural variables that are, however, often interrelated, making experiments necessary to understand the role of single variables on ecosystem functions. How gaps and deadwood, two main outcomes of forest management influence dung removal, is unknown.2. We tested if dung removal responds to gap creation and deadwood provisioning or if treatment effects are mediated via responses of dung beetles. We expected lower removal rates in gaps due to lower dung beetle biomass and diversity.3. We sampled dung beetles and measured dung removal in a highly-replicated fullfactorial forest experiment established at 29 sites in three regions of Germany (treatments: Gap, Gap + Deadwood, Deadwood, Control). All gaps were experimentally created and had a diameter of around 30 m. 4. Dung beetle diversity, biomass and dung removal were each lower in gaps than in controls. Dung removal decreased from 61.9% in controls to 48.5% in gaps, irrespective of whether or not the gap had deadwood. This treatment effect was primarily driven by dung beetle biomass but not diversity. Furthermore, dung removal was reduced to 56.9% in the deadwood treatment. 5. Our findings are not consistent with complementarity effects of different dung beetle species linked to biodiversity-ecosystem functioning relationships that have been shown in several ecosystems. In contrast, identity effects can be pronounced: gaps reduced the abundance of a large-bodied key forest species (Anoplotrupes stercorosus), without compensatory recruitment of open land species. While gaps and deadwood are important for many forest organisms, dung beetles and dung removal respond negatively. Our results exemplify how