Stomach ulcers and the gut microbiome: What is the link?


Stomach ulcers can be very painful and unpleasant. If left untreated, they can also become dangerous. They may be caused by a number of factors and can persist over time, especially if not treated effectively.

Research suggests that the gut microbiome plays a significant role in both the development and healing of stomach ulcers.

In this article, we will explore:

  • What causes stomach ulcers
  • How your gut microbiome may influence ulcer risk and recovery
  • Medicines used to treat ulcers
  • Lifestyle and dietary strategies that support both ulcer healing and gut health

What are stomach ulcers?

Stomach ulcers (sometimes referred to as gastric ulcers) are open sores on the stomach lining. You can also get them in the intestine; these are known as duodenal ulcers. Both stomach and duodenal ulcers are commonly referred to as peptic ulcers.

Stomach ulcers commonly cause a burning or gnawing pain in the centre of the abdomen. This pain can travel from the abdomen up to your neck, down to your belly button, or through to your back. The pain can last anywhere from a few minutes to hours; it mostly starts in the hours after you have eaten. Some people may also find that the pain wakes them up during the night.

However, not all stomach ulcers cause pain. Sometimes, they may manifest themselves as other symptoms, such as heartburn, nausea or indigestion. You may also experience loss of appetite, which may cause weight loss. Vomiting is another symptom.

Stomach ulcers are common and can affect people of all ages, however they mostly occur in individuals over the age of 60. Men are also more likely to develop a stomach ulcer.

What causes stomach ulcers?

Stomach ulcers can be caused by several different factors. The two most common causes are:

  • Long-term use of nonsteroidal anti-inflammatory drugs (NSAIDs)
  • Infection with a bacteria called Helicobacter pylori (H. pylori)

Other risk factors include smoking, heavy alcohol use, stress, and poor diet—all of which can also impact the gut microbiome.

H. pylori and the gut microbiome connection

The gut microbiome plays a key role in protecting the stomach lining, regulating inflammation, and maintaining immune balance. An imbalance in the microbiome, known as dysbiosis, can contribute to:

  • Increased susceptibility to H. pylori infection
  • Poor healing of the stomach lining
  • Higher risk of ulcer recurrence

A healthy gut microbiome, abundant with healthy gut bacteria may help to reduce the risk of a H. pylori infection by inhibiting the bacterial growth and strengthening the gastric barrier.

Microbiome testing may help detect imbalances in beneficial vs. harmful bacteria, providing insights into the underlying environment that allows ulcers to form or persist.

Our complete gut microbiome test can also identify the presence of H.Pylori in the gut.

NSAIDs and stomach ulcers

If a stomach ulcer has been caused due to taking a nonsteroidal anti-inflammatory drug (NSAID), you will normally be prescribed a proton pump inhibitor (PPI) such as lansoprazole or omeprazole by your doctor which can protect your stomach when taking NSAID's such as Naproxen. They may also review whether you should continue NSAID use.

Alternatively, you may be advised to use a painkiller with less impact on the stomach—typically paracetamol. If long-term NSAID use is necessary for a chronic condition, a PPI is usually prescribed alongside to reduce the risk of further damage to the stomach lining.

Symptoms of a stomach ulcer

If you have symptoms of a stomach ulcer, you should talk to your doctor.

Because not all stomach ulcers cause pain, you may not notice them until a complication arises. The most common complication of stomach ulcers is internal bleeding, which may cause:

  • Vomiting blood
  • Passing black, tarry stools
  • Pale skin
  • Heart palpitations
  • Anaemia
  • Fatigue
  • Breathlessness

Other, less common symptoms of a stomach ulcer include:

When should you seek medical advice?

If you have a sudden and sharp pain in your stomach that is getting worse, you should talk to your doctor as soon as possible. Sometimes, perforation may occur. This is when the stomach lining splits open, allowing bacteria to escape and cause infection in the lining of the abdomen.

This infection can spread to the blood and lead to sepsis, a life-threatening condition that can affect multiple organs.

Other signs of a serious complication include:

  • Vomiting blood
  • Black, sticky stools

Seek urgent medical help from your GP or go to your nearest A&E if you experience any of these symptoms.

Diagnosing a stomach ulcer

When diagnosing a stomach ulcer, your doctor will ask about medications, especially NSAID use.

They may also check for H. pylori infection, one of the most common causes of peptic ulcers. This can be done through:

  • Urea breath test – detects how H. pylori breaks down a substance in your stomach
  • Stool test – identifies H. pylori in your digestive tract
  • Blood test – checks for antibodies against H. pylori
  • Gastroscopy – a camera is inserted down the throat to examine the stomach directly
  • A gut health stool test can identify the presence of H. pylori, however it can not diagnose a stomach ulcer and is not the first line testing option.

If an infection is found, it will be treated alongside acid-suppressing medication.

Treatment for stomach ulcers

If H. pylori is present, the first line treatment is a combination of antibiotics and a proton pump inhibitor (PPI).

PPIs reduce the amount of stomach acid produced, which allows the ulcer to heal naturally.

Proton Pump Inhibitors (PPIs)

There are several PPIs commonly prescribed in the UK to treat ulcers and acid-related conditions, including:

  • Lansoprazole
  • Omeprazole
  • Pantoprazole

These are prescription-only medicines used to help treat and prevent stomach ulcers. If prescribed by a doctor, lansoprazole may also be used in children.

PPIs work by blocking acid production, which protects the stomach lining and supports ulcer healing.

While PPIs are effective for ulcer healing, long-term use has been shown to affect the gut microbiome. Research indicates that PPIs may:

  • Reduce microbial diversity
  • Increase the risk of bacterial overgrowth (especially in the small intestine, known as SIBO)
  • Lower resistance to gut infections such as Clostridium difficile
  • Affect the absorption of key nutrients (like magnesium, calcium and vitamin B12)

Because the gut microbiome helps regulate inflammation, immunity and repair processes, these changes may contribute to ulcer recurrence or longer healing time in some individuals.

If you are taking a PPI long term, microbiome testing can help monitor your gut health and guide dietary or probiotic interventions.

Antacids

Antacids are available over the counter and provide immediate symptom relief. They work by neutralising stomach acid and forming a protective coating on the stomach lining.

They are most effective when taken after meals, when acid levels are higher.

Lifestyle changes to support ulcer healing and gut health

Diet and microbiome-friendly foods

While food doesn't directly cause ulcers, your diet can influence your gut environment, inflammation, and the healing process. Certain foods have been shown to help combat H. pylori or support beneficial gut bacteria.

Consider including:

  • Leafy greens (e.g. spinach, kale)
  • Cruciferous vegetables (broccoli, cabbage, cauliflower)
  • Apples and berries – rich in polyphenols
  • Olive oil – anti-inflammatory properties
  • Probiotic foods (e.g. yoghurt, kefir, sauerkraut)
  • Prebiotic fibre (e.g. leeks, onions, garlic, oats)

These foods support a healthier gut microbiome, which may aid recovery and reduce the risk of future ulcers.

Additional lifestyle strategies

  • Quit smoking – it increases stomach acid and slows healing
  • Limit alcohol – irritates the stomach lining
  • Manage stress – chronic stress may increase acid production and inflammation
  • Sleep and exercise – support overall gut function and immune regulation

What does stomach ulcer pain feel like?

The main symptom is a burning pain in the stomach. However, not all ulcers cause pain until complications arise. This is why it’s important to seek help if you experience other signs such as black stools, nausea, or vomiting blood.

Do stomach ulcers go away on their own?

Some stomach ulcers may heal naturally over time, but if the underlying cause (such as H. pylori or NSAID use) is not treated, the ulcer is unlikely to fully heal.

Does stress cause stomach ulcers?

Chronic stress can increase acid production and disrupt the gut microbiome, making the stomach lining more vulnerable. A “stress ulcer” refers to ulcers caused or worsened by extreme physical or emotional stress.

Summary

Stomach ulcers are common and treatable. Proton pump inhibitors, when used appropriately, are effective for healing ulcers and relieving symptoms. However, it’s important to be aware of how PPIs can affect your gut microbiome, particularly if used long term.

Reading next