Intraguild predation, which is common for generalist predators, is a specific form of omnivory that may suppress the biological control of a pest. The dietary flexibility of a given organism depends on the choice of the C3 (banana crop) and the C4 (weeds) pathways they use and on the trophic level on which they feed. Understanding the conditions in which intraguild predation decreases biological control is a major issue in agroecosystems. We tested whether the contribution of different primary producer pathways in diets of generalist predators mediates the level of intraguild predation. We studied 10 agroecosystems in which banana plants (C3 metabolism) were diversely associated with weeds (C4 metabolism). Diversity in litter macrofauna was relatively low, with a mean between three and eight species per trap. Measurement of stable isotopes showed a significant decrease in the δ15N values of generalist predators when the C4 pathway contributed more than the C3 pathway to their diet. We rejected hypotheses that an increase in the abundance of prey and that a decrease in prey's δ15N values occur when the C4 pathway contributes more than the C3 pathway to their diet. The results are consistent with the diet modification hypothesis, that is, intraguild predation is lower when the C4 (weeds) pathway is preferred to the C3 pathway. Our results suggest that when the C4 pathway of weeds is more exploited by herbivores (or detritivores), generalist predators tend to consume these herbivores and thus neglect the intraguild prey. The diverse C4 plant community probably supports a diverse herbivore community that provides alternative prey. Our results provide evidence that increasing plant diversity in agroecosystems should decrease intraguild predation of generalist predators and should therefore improve pest regulation. In an applied perspective, plant diversity could be increased by establishing a more diverse cover-crop community.