Many temperate forests are changing in composition due to a combination of changes in land‐use, management and climate‐related disturbances. Previous research has shown that in some regions these changes frequently favour drought‐tolerant tree species. However, the effects of these changes in composition on forest functioning (e.g. productivity) are unclear. We studied 25 years of change in individual tree biomass growth, ingrowth and mortality, and community composition and total plot biomass across 2663 permanent forest plots in Catalonia (NE Spain) comprising 85,220 trees of 59 species. We focused on the relationship between community‐level forest productivity and drought tolerance (DT), which was estimated using hydraulic traits as well as biogeographic indicators. We found that there was a small increase (1.6%–3.2% on average) in community‐mean DT (DTcwm) during the study period, concurrent with a strong increase (12.4%–19.4% on average) in DT richness (DTric; i.e. trait range). Most importantly, we found that the mean DT was negatively related to forest productivity, which was explained because drought‐tolerant tree species have lower tree‐level growth. In contrast, DT richness was strongly and positively related to forest productivity, probably because it allowed for a more stable production along wet and dry periods. These results suggest a negative impact of ongoing climate change on forest productivity mediated by functional composition shifts (i.e. selection of drought‐tolerant species), and a positive effect of increased DT richness as a consequence of land‐use legacies. Such a trend towards functional diversification, although temporary, would increase forests’ capacity to resist drought and place them in a better position to face the expected change in climate.