1. There is a growing recognition that functional measures of diversity, based on quantification of functionally important species traits, are useful for explaining variation in ecosystem processes. However, the mechanisms linking functional diversity to different processes remain poorly understood, hindering development of a predictive framework for ecosystem functioning based on species traits.2. The current understanding of how the functional traits of aquatic plants (macrophytes) affect nitrogen (N) cycling by regulating microbial communities and their activity in freshwater habitats is particularly limited. Denitrifying bacteria are typically associated with the roots of both aquatic and terrestrial plants and denitrification is the main cause of loss of N from ecosystems. Disentangling the interplay between plants and microbial denitrifiers is key to understanding variation in rates of denitrification from local to landscape scales.3. In a mesocosm experiment, we varied the species richness (monocultures or two-species mixtures) and composition of macrophytes. We quantified effects of both macrophyte functional diversity, quantified as functional trait dissimilarity, and functional trait composition, quantified as community weighted mean trait values, on N removal in wetlands. We used structural equation modelling to disentangle the direct and indirect influences of traits on N accumulation in plant biomass, denitrification activity and abundance of key bacterial denitrification genes (nirS and nirK).4. Both functional diversity and functional trait composition regulated N removal, explaining 70%-94% variation in the underlying ecosystem processes. Increased macrophyte functional diversity increased plant N accumulation, and indirectly enhanced denitrification by increasing denitrification gene abundance. Among traits, greater plant relative growth rates, specific leaf area and above-ground biomass increased plant N accumulation. Denitrification activity increased with increasing below-ground biomass but decreased with increasing root diameter.5. These findings improve our understanding of N removal in freshwater wetlands dominated by macrophytes, and have broad ecological implications for wetland management targeting enhanced ecosystem services. Our results highlight the potential for optimizing denitrification and plant N accumulation in wetlands and thereby improving water purification by increasing macrophyte functional diversity and ensuring the presence of key traits in macrophyte assemblages