Vaccine is the most effective way to prevent the spread of communicable diseases, but the immune response induced by it varies greatly between individuals and populations in different regions of the world. Current studies have identified the composition and function of the gut microbiota as key factors in modulating the immune response to vaccination. This article mainly reviews the differences in gut microbiota among different groups of vaccinated people and animals, explores the possible mechanism of vaccine immunity affected by gut microbiota, and reviews the strategies for targeting gut microbiota to improve vaccine efficacy.