No one knows for sure how H. pylori spreads or why some people develop peptic ulcers without being infected with H. pylori, so prevention is difficult. Researchers are trying to develop a vaccine to prevent infection.
If you have already developed a peptic ulcer, there are things you can do to prevent worsening of your symptoms. They include:
Avoid foods that irritate your stomach. Use common sense: If it upsets your stomach when you eat it, avoid it. Everyone is different, but spicy foods and fatty foods are common irritants.
Stop smoking. Heavy smokers are more likely to develop duodenal ulcers than nonsmokers.
Practice moderation. Heavy consumption of alcohol and nonsteroidal anti-inflammatory drugs (NSAIDS including aspirin and ibuprofen) has been shown to contribute to the development of ulcers, so keep your intake to a minimum.
Learn how to control your stress levels. Regular exercise and mind-body relaxation techniques (such as guided imagery and yoga or tai chi) are often helpful.