There are many steps a person can take to prevent infection with Shigella.
According to the WHO, “[d]espite the continuing challenge posed by Shigella, there is room for optimism as advances in biotechnology have enabled the development of a new generation of candidate vaccines that shows great promise for the prevention of Shigella disease.” Although many vaccines to protect against shigellosis are under development, at this time, such a vaccine has yet to be perfected. Thus, in the meantime, preventing infection is the best approach, and that means implementing proper sanitation measures. As noted in one text:
A safe water supply is important for the control of shigellosis and is probably the single most important factor in areas with substandard sanitation facilities. Chlorination is another factor important in decreasing the incidence of all enteric bacterial infections. Of critical importance to the establishment of a safe water supply is the general level of sanitation in the area and the establishment of an effective sewage disposal system.
It takes but a few—far less than 100—Shigella bacteria to cause infection. Moreover, a person can be infectious even if there are no symptoms, either because they remained asymptomatic or continued to shed the bacteria in their stool for a week or two after recovering.
The spread of Shigella from an infected person to other persons can be avoided by frequent and careful handwashing with soap and hot water. Handwashing among children should be frequent and supervised by an adult in daycare centers and homes with children who have not been fully toilet trained.
If a child in diapers has shigellosis, everyone who changes the child's diapers should be sure the diapers are disposed of properly in a closed-lid garbage can and should wash their hands and the child’s hands carefully with soap and warm water immediately after the diaper has been changed. After use, the diaper changing area should be wiped down with a disinfectant such as diluted household bleach, Lysol, or bactericidal wipes. When possible, young children with a Shigella infection who are still in diapers should not be in contact with uninfected children.
Basic food safety precautions and disinfection of drinking water should prevent Shigella bacteria from contaminating food and water. Nonetheless, it should go without saying that people with shigellosis should not prepare food or drinks for others until they have been confirmed (by a stool culture) to no longer be shedding Shigella bacteria in their stool. At swimming beaches, there should be bathrooms and handwashing stations near the swimming area to help keep the water from becoming contaminated. Daycare centers should not provide communal water play areas.
Simple precautions taken while traveling to the developing world can prevent shigellosis. Drink only treated or boiled water, and eat only cooked hot foods or fruits you peel yourself. The same precautions prevent other types of traveler's diarrhea.