Commercially made mayonnaise has an undeserved bad reputation as a cause of food spoilage and, in turn, food poisoning. Certain ingredients in commercially made mayo, though, may actually help keep the sandwich spread fresh. It is homemade mayonnaise you need to worry about.
Truth be told, it is usually cross-contamination from the other ingredients (like the chicken in a chicken salad) that cause foodborne illness, not the prepared mayo.
Commercially Made Mayonnaise
Mayonnaise at its most basic is made of oil, egg yolk, and an acid such as vinegar or lemon juice, but have you ever read the ingredient list on a jar of mayo? Commercially made, jarred mayonnaise is loaded with acid and preservatives that can actually extend the life of the condiment by killing bacteria. In addition, the eggs used in prepared mayonnaise are pasteurized to kill harmful bacteria.
A study published in the Journal of Food Protection found that when commercially made mayonnaise was mixed with contaminated chicken and ham, the mayo slowed—or even stopped—the production of salmonella and staphylococcus bacteria. The more mayonnaise that was added, the slower the growth of bacteria became.
On the other hand, homemade mayonnaise carries more risk if it's not handled properly. Traditional homemade mayonnaise contains raw egg yolks that are usually from eggs that have not been pasteurized, so foods that contain homemade mayo should be eaten immediately or properly refrigerated. The best bet is to make up only the amount of mayonnaise that you need and do not plan on leftovers. Homemade mayonnaise will last only up to 4 days when properly refrigerated.
The good thing is that it is quick and easy to make your own mayo, so if you prefer your mayonnaise homemade, you should not need the convenience of jarred mayonnaise except for that last-minute sandwich. If you are not comfortable using raw egg yolks, the perfect solution is to purchase irradiated eggs, which are now available in most markets. Irradiated eggs carry no risk of salmonella contamination and are perfectly safe to use in raw preparations.
If you are unable to find irradiated eggs but don't want to take the risk of using raw eggs, you can make a cooked mayonnaise recipe. Cooked recipes warm the egg yolks just to the point where any bacteria will be killed but not enough to actually cook the yolks.
Doyle MP, Bains NJ, Schoeni JL, Foster EM. Fate of Salmonella typhimurium and Staphylococcus aureus in Meat Salads Prepared with Mayonnaise. J Food Prot. 1982;45(2):152-156. doi:10.4315/0362-028X-45.2.152
US Department of Agriculture. Is homemade mayonnaise safe?. July 17, 2019.
Rodrigues EC, Souza MC, Toledo SS, et al. Effects of gamma irradiation on the viability and phenotypic characteristics of Salmonella Enteritidis inoculated into specific-pathogen-free eggs. J Food Prot. 2011;74(12):2031-8. doi:10.4315/0362-028X.JFP-11-086