1. Parasitoids are known to utilise learning of herbivore‐induced plant volatiles (HIPVs) when foraging for their herbivorous host. In natural situations these hosts share food plants with other, non‐suitable herbivores (non‐hosts). Simultaneous infestation of plants by hosts and non‐hosts has been found to result in induction of HIPVs that differ from host‐infested plants. Each non‐host herbivore may have different effects on HIPVs when sharing the food plant with hosts, and thus parasitoids may learn that plants with a specific non‐host herbivore also contain the host.2. This study investigated the adaptive nature of learning by a foraging parasitoid that had acquired oviposition experience on a plant infested with both hosts and different non‐hosts in the laboratory and in semi‐field experiments.3. In two‐choice preference tests, the parasitoid Cotesia glomerata shifted its preference towards HIPVs of a plant–host–non‐host complex previously associated with an oviposition experience. It could, indeed, learn that the presence of its host is associated with HIPVs induced by simultaneous feeding of its host Pieris brassicae and either the non‐host caterpillar Mamestra brassicae or the non‐host aphid Myzus persicae. However, the learned preference found in the laboratory did not translate into parasitisation preferences for hosts accompanying non‐host caterpillars or aphids in a semi‐field situation.4. This paper discusses the importance of learning in parasitoid foraging, and debates why observed learned preferences for HIPVs in the laboratory may cancel out under some field experimental conditions.