The human gut microbiota harbors a heterogeneous and dynamic community of microorganisms that coexist with the host to exert a marked influence on human physiology and health. Throughout the lifespan, diet can shape the composition and diversity of the members of the gut microbiota by determining the microorganisms that will colonize, persist, or become extinct. This is no more pronounced than during early-life succession of the gut microbiome when food type and source changes relatively often and food preferences are established, which is largely determined by geographic location and the customs and cultural practices of that environment. These dietary selection pressures continue throughout life, as society has become increasingly mobile and as we consume new foods to which we have had no previous exposure. Dietary selection pressures also come in the form of overall reduction or excess such as with the growing problems of food insecurity (lack of food) as well as of dietary obesity (overconsumption). These are well-documented forms of dietary selection pressures that have profound impact on the gut microbiota that ultimately may contribute to or worsen disease. However, diets and dietary components can also be used to promote healthy microbial functions in the gut, which will require tailored approaches taking into account an individual's personal history and doing away with one-size-fits-all nutrition. Herein, we summarize current knowledge on major dietary selection pressures that influence gut microbiota structure and function across and within populations, and discuss both the potential of personalized dietary solutions to health and disease and the challenges of implementation.