The presence of nonprey or nonhosts is known to reduce the strength of consumer– resource interactions by increasing the consumer's effort needed to find its resource. These interference effects can have a stabilizing effect on consumer–resource dynamics, but have also been invoked to explain parasitoid extinctions. To understand how nonhosts affect parasitoids, we manipulated the density and diversity of nonhost aphids using experimental host–parasitoid communities and tested how this affects parasitation efficiency of two aphid parasitoid species. To further study the behavioral response of parasitoids to nonhosts, we tested for changes in parasitoid time allocation in relation to their host‐finding strategies. The proportion of successful attacks (attack rate) in both parasitoid species was reduced by the presence of nonhosts. The parasitoid Aphidius megourae was strongly affected by increasing nonhost diversity with the attack rate dropping from 0.39 without nonhosts to 0.05 with high diversity of nonhosts, while Lysiphlebus fabarum responded less strongly, but in a more pronounced way to an increase in nonhost density. Our experiments further showed that increasing nonhost diversity caused host searching and attacking activity levels to fall in A. megourae, but not in L. fabarum, and that A. megourae changed its behavior after a period of time in the presence of nonhosts by increasing its time spent resting. This study shows that nonhost density and diversity in the environment are crucial determinants for the strength of consumer–resource interactions. Their impact upon a consumer's efficiency strongly depends on its host/prey finding strategy as demonstrated by the different responses for the two parasitoid species. We discuss that these trait‐mediated indirect interactions between host and nonhost species are important for community stability, acting either stabilizing or destabilizing depending on the level of nonhost density or diversity present.