In order to identify types of forage that inhibit pasture contamination, an evaluation was performed of the effect of the forage legumes Trifolium repens (white clover), Trifolium pratense (red clover) and Lotus corniculatus (bird's-foot-trefoil) on the survival and migration of infective larvae (L3) of gastrointestinal nematodes (GIN) of sheep. An experimental area of 441 m2 was divided into four blocks, subdivided into areas of 1.20 × 1.20 in which the three forage legumes were separately overseeded. After growth of the forage in each subdivision, experimental units were established that were later artificially contaminated with sheep faeces containing GIN eggs. Between October and December 2018, pasture, faecal and soil samples were collected on four occasions during weeks 1, 2, 4 and 8 after the deposition of faeces. In week 6, the forage legumes in all the experimental units were mown to simulate grazing. The number of L3 was quantified to determine their survival in the pasture, faeces and soil. In addition, the horizontal migration of L3 was measured at two distances from the faecal pellets (10 and 30 cm), as well as their vertical migration at two heights of the plant stems, that is, lower half and upper half. Larvae vertical migration was affected by the forage species (P < 0.001), in that bird's-foot-trefoil contained fewer larvae in the upper stratum. Bird's-foot-trefoil restricted the migration of L3 to the upper stratum of the plant, which could potentially decrease the risk of infection by intestinal nematodes in grazing sheep.