Mastitis, a disease that affects both dairy herds and humans, is recognized as the most common source of losses in the dairy industry. Antibiotics have been used for years as the primary treatment for mastitis. However, abuse of antibiotics has led to the emergence of resistant strains and the presence of drug residues and has increased the difficulty of curing this disease. In addition, antibiotics kill most of the microbes that are present in the digestive tract, leading to imbalances in the gut microbiome and destruction of the ecosystem that is normally present in the gut. Gut microbiota play an important role in the host's health and could be considered the "second brain" of the body. In recent years, the gut microbiota and their metabolites, including lipopolysaccharide (LPS) and short-chain fatty acids (SCFAs), have been shown to participate in the development of mastitis. LPS is the main component of the cell walls of gram-negative bacteria. Overproduction of rumen-derived LPS injures the rumen epithelium, resulting in the entry of LPS into the blood and damaged liver function; once in the blood, it circulates into the mammary gland, increasing blood-barrier permeability and leading to mammary gland inflammation. SCFAs, which are produced by gut microbiota as fermentation products, have a protective effect on mammary gland inflammatory responses and help maintain the function of the blood-milk barrier. Recently, increasing attention has been focused on the use of probiotics as a promising alternative for the treatment of mastitis. This review summarizes the effects of the gut microbiome and its metabolites on mastitis as well as the current of probiotics in mastitis. This work may provide a valuable theoretical foundation for the development of fresh ideas for the prevention and treatment of mastitis.