► Longitarsus melanocephalus sequesters iridoid glycosides from its host plant Plantago lanceolata. ► Ants have been described as predators that are especially sensitive to iridoids. ► Two ant species were tested in prey choice experiments. ► Myrmica rubra avoided L. melanocephalus larvae and pupae. ► Lasius niger in contrast was not deterred by the iridoid glycosides present in the beetle offspring.