Can You Prevent Peptic Ulcers?

Medically Reviewed by Jennifer Robinson, MD on April 19, 2020

A peptic ulcer is a sore in the lining of your stomach or the top part of your small intestine. These ulcers usually cause burning pain. They also can cause bloating, nausea, vomiting, and other uncomfortable symptoms that can make you less hungry and mess with your sleep.

Too much stomach acid or a problem with the lining that protects your stomach can lead to peptic ulcers. Most of the time, they’re caused by using certain painkillers too often or by a type of bacteria called H. pylori. These bacteria inflame your stomach lining and make it more likely to tear.

While stress and spicy foods can make symptoms of a peptic ulcer worse, they don’t seem to make you more likely to have one. But a few other things can raise your chances.

Be Careful When You Take Pain Relievers

Some people who have arthritis or other conditions that cause chronic pain take non-steroidal anti-inflammatory drugs (NSAIDs) for weeks or months at a time to ease pain and swelling. These medicines can affect the mucus that protects your stomach against acid and make you more likely to have peptic ulcers.

These pain relievers include:

You're more likely to get an ulcer while taking one of these if you:

  • Are over age 65
  • Are infected with H. pylori bacteria
  • Take more than one NSAID at a time
  • Have had a peptic ulcer in the past
  • Also take a steroid drug or selective serotonin reuptake inhibitor (SSRI)

To lower your chances for peptic ulcers while you take NSAIDs:

  • Use the lowest possible dose to control your symptoms, and stop taking them as soon as you no longer need them.
  • Take your medicine with food.
  • Don't drink alcohol while you’re taking these medicines.

While you're on NSAIDs, you can take medicine to lower the amount of acid your stomach makes. Drugs that can do that include:

You can also take the drug misoprostol (Cytotec) to boost the amount of protective mucus your stomach makes. But that can cause side effects like diarrhea and stomach cramps.

Don’t Smoke, and Limit Alcohol

These two habits make you more likely to get peptic ulcers. Both thin the mucus lining that protects your stomach from acid, leading to more acid.

Ask your doctor to recommend a program to help you quit smoking. And talk with them about how much alcohol is safe for you to drink.

Manage Stress

Stress can make the symptoms of a peptic ulcer worse. Figure out what’s causing issues for you and see how you can deal with it better. For example, getting enough sleep can help with that. It also can boost your immune system.

Consider Probiotics

Millions of bacteria normally live in your gut. Some, like H. pylori, cause disease. Others are good for you because they help crowd out harmful bacteria. These helpful bacteria are called probiotics.

They’re still being studied, but researchers think they may help with peptic ulcers. You can find them in foods like these:

  • Dairy products that have live cultures, like yogurt, kefir, and aged cheeses
  • Sauerkraut
  • Kimchi
  • Miso
  • Tempeh

Prevent H. pylori Infection

About two-thirds of people around the world have this type of infection, but most don’t get ulcers because of it. Doctors don’t know how you can avoid H. pylori, but they think it spreads from person to person or through food or water.

You can do some things to make an infection less likely:

  • Wash your hands often during the day with warm water and soap so you don't catch or spread H. pylori bacteria. Clean your hands before you eat and after you go to the bathroom. If you don't have soap and water close by, use an alcohol-based hand sanitizer.
  • Cook meat and other foods all the way through.
  • Only drink water that you know is clean.
WebMD Medical Reference



Academy of Nutrition and Dietetics: "Prebiotics and Probiotics: Creating a Healthier You."

CDC: "Helicobacter pylori."

Harvard Medical School: "Peptic Ulcer."

Mayo Clinic: "Peptic Ulcer: Self-management," "Peptic Ulcer: Symptoms and Causes."

National Center for Complementary and Integrative Health: "Probiotics: In Depth."

PubMed Health: "Gastritis: How can you prevent peptic ulcers caused by painkillers?"

The Journal of Nutrition: "Helicobacter pylori and probiotics."

The Medical Letter: "Primary Prevention of Ulcers in Patients Taking Aspirin or NSAIDs."

© 2020 WebMD, LLC. All rights reserved.
Click to view privacy policy and trust info