Plant diversity and plant-consumer interactions likely interact to influence ecosystem carbon fluxes but experimental evidence is scarce. We examined how experimental removal of foliar fungi, soil fungi and arthropods from experimental prairies planted with 1, 4 or 16 plant species affected instantaneous rates of carbon uptake (GPP), ecosystem respiration (Re) and net ecosystem exchange (NEE). Increased plant diversity doubled plant biomass, in turn doubling GPP and Re, but NEE remained unchanged. Removing foliar fungi increased GPP and NEE, with greatest effects at low plant diversity. After accounting for plant biomass, we found that removing foliar fungi increased mass-specific flux rates by 48% by altering plant species composition and community-wide foliar nitrogen content. However, this elevated NEE effect disappeared when soil fungi and arthropods were also removed, demonstrating ecosystem-scale impacts of interactions among consumer groups. Thus, plant diversity and consumer context determine the effects of plant-fungal interactions on ecosystem carbon fluxes.