Secretory antibody responses (Immunoglobulin A, IgA) against repetitive bacterial surface glycans, such as O-antigens and capsules, can protect against intestinal pathogenic Enterobacteriaceae . However, efficacy of such immune responses has been limited by rapid glycan evolution and phase-variation. Here, we track IgA-driven O-antigen variation in Salmonella Typhimurium, and use this to assemble an oligovalent oral vaccine which sets an evolutionary trap. IgA targeting all fitness-neutral O-antigen escape variants of Salmonella Typhimurium rapidly selected for mutants with very short O-antigen: a phenotype known to display major fitness costs and virulence attenuation in naive hosts. Evolutionary trap vaccination therefore represents an alternative concept in vaccine design. This approach capitalizes on the inevitable and rapid evolution of bacteria in the gut, and can combine protection of the individual with elimination of virulent enteropathogen reservoirs. One sentence summary By tracking vaccine-driven Salmonella evolution in the intestine, it is possible to rationally design oligovalent oral vaccines that generate an evolutionary trap.