Stomach Ulcer: Causes, Testing and Treatment

Until the 1980s, stomach ulcers were understood as a disease of stress, personality and acid. Patients were told to relax, drink milk and avoid spicy food, and many spent decades with a condition that relapsed endlessly because nobody was treating the cause.
Then two Australian researchers proposed that a bacterium was responsible, were widely disbelieved, and one of them drank a flask of the organism to prove the point — developing gastritis and then curing himself with antibiotics. They received the Nobel Prize in 2005, and peptic ulcer disease went from a lifelong condition to a curable infection.
That history matters because the old advice persists. This guide covers what actually causes ulcers, how they are diagnosed, which treatments eradicate the infection, and which widely repeated recommendations have no evidence behind them.
🧠 The principle that governs everything: an ulcer is a symptom of something, and there are two main somethings. Either Helicobacter pylori infection or anti-inflammatory painkillers account for the large majority. Suppressing acid heals the ulcer; it does not remove the cause. This is why ulcers treated with acid suppression alone come back, and why testing for H. pylori is not optional.
🔬 What an ulcer actually is
The stomach produces hydrochloric acid strong enough to damage most tissue, and protects itself with a mucus layer, bicarbonate secretion, rapid cell renewal and a rich blood supply. An ulcer forms where that defence fails and acid and pepsin erode through the lining into deeper layers.
The distinction from gastritis is one of depth. Gastritis is inflammation of the surface; an ulcer is a defined break penetrating beneath it. Ulcers occur in the stomach itself, where they are called gastric, and in the first part of the small intestine, where they are called duodenal. Duodenal ulcers are commoner, more strongly associated with H. pylori, and almost never malignant. Gastric ulcers occur at older ages and can occasionally represent a cancer, which is why they are biopsied and followed up in a way duodenal ulcers are not.
🦠 What causes them
| Cause | Notes |
|---|---|
| Helicobacter pylori | A spiral bacterium that survives in the stomach by neutralising acid around itself; the dominant cause of duodenal ulcers |
| NSAIDs | Aspirin, ibuprofen, naproxen, diclofenac and similar drugs block the prostaglandins that maintain the protective mucus layer |
| Both together | The risk multiplies rather than adds |
| Smoking | Impairs healing, raises recurrence, reduces mucosal defence |
| Severe physiological stress | Critical illness, major burns, ventilation — a hospital phenomenon, not everyday stress |
| Zollinger-Ellison syndrome | A rare tumour producing excess acid; suspected with multiple, refractory or unusually sited ulcers |
| Other medicines | Corticosteroids and SSRIs raise risk mainly when combined with NSAIDs; some chemotherapy agents |
| No identified cause | A recognised minority, increasing as H. pylori becomes less common |
H. pylori is remarkably widespread — carried by a large share of the world population, acquired usually in childhood, and transmitted through close contact and contaminated water. The great majority of carriers never develop an ulcer. What determines who does involves bacterial strain, host genetics and the pattern of inflammation produced.
❌ What does not cause them
The persistence of these beliefs actively harms people, by directing effort toward dietary restriction and away from testing.
Everyday stress does not cause ulcers. Psychological stress may worsen symptoms and influence health behaviours, but it does not produce the lesion. The stress ulcers of medical literature occur in intensive care units following major physiological insult, which is a different phenomenon entirely.
Spicy food does not cause ulcers. Chilli can irritate an existing ulcer and produce symptoms, and there is some evidence that capsaicin is mildly protective. Avoiding it may be comfortable; it is not treatment.
Personality type does not cause ulcers. The idea of the driven, anxious ulcer patient was a mid-century construction that survived because it felt plausible.
Milk does not help. It buffers acid briefly and then stimulates further acid secretion, so it makes matters worse over a few hours. Drinking milk for ulcer pain was standard advice for decades and was actively counterproductive.
Acidic food does not cause ulcers. Stomach acid is far stronger than anything in a lemon.
🩹 How they present
The classic symptom is a burning or gnawing pain in the upper abdomen. Its relationship to food is somewhat characteristic: duodenal ulcer pain often improves with eating and returns two to three hours later, sometimes waking the person at night, while gastric ulcer pain frequently worsens with eating. Neither pattern is reliable enough to diagnose on.
Bloating, nausea, early fullness, belching, heartburn and reduced appetite accompany it. Weight loss occurs and should never be dismissed.
⚠️ A large proportion of ulcers cause no symptoms at all until they bleed or perforate, and this is particularly true of ulcers caused by anti-inflammatory drugs, because those same drugs suppress the pain the ulcer would otherwise produce. Older people on long-term aspirin or ibuprofen are the group most likely to present with a serious complication as the first sign that anything was wrong.
🔴 Complications and warning signs
Three complications account for the seriousness of the condition.
Bleeding is the commonest. It presents as vomiting blood or material resembling coffee grounds, or as black tarry stools with a distinctive smell. It can also be slow and hidden, causing iron deficiency anaemia with fatigue and breathlessness and no digestive symptoms at all.
Perforation is a surgical emergency: sudden severe abdominal pain, a rigid board-like abdomen, and rapid deterioration as stomach contents enter the abdominal cavity.
Obstruction follows scarring at the stomach outlet, producing persistent vomiting of undigested food, fullness and weight loss.
| Warning sign | Action |
|---|---|
| Vomiting blood or coffee-ground material | Emergency assessment immediately |
| Black tarry stools | Emergency assessment immediately |
| Sudden severe abdominal pain | Emergency assessment immediately |
| Difficulty swallowing | Urgent endoscopy |
| Unintended weight loss | Urgent endoscopy |
| Persistent vomiting | Urgent endoscopy |
| Iron deficiency anaemia | Urgent investigation |
| New indigestion over age fifty-five | Endoscopy rather than empirical treatment |
🧪 Diagnosis
Endoscopy visualises the ulcer directly, allows biopsy, permits treatment of bleeding, and tests for H. pylori at the same time. It is indicated where warning signs are present, in older patients with new symptoms, and to confirm healing of gastric ulcers, since a small proportion are malignant.
Non-invasive H. pylori testing suits younger patients without warning signs. The urea breath test and the stool antigen test both detect active infection and are used for diagnosis and to confirm cure. Blood antibody tests are far less useful, because antibodies persist after the infection has cleared and a positive result cannot distinguish current from past infection.
🔴 The commonest testing error, and it produces false negatives. Proton pump inhibitors must be stopped for at least two weeks, and antibiotics or bismuth for four weeks, before a breath or stool test. Acid suppression reduces the bacterial population below the detection threshold without eradicating it. Testing someone who is taking omeprazole and telling them they do not have H. pylori is a routine error, and it sends people back into another cycle of unexplained relapse.
💊 Acid suppression
Proton pump inhibitors are the mainstay. They block the enzyme pump that secretes acid, reducing production far more effectively than earlier drug classes, and they heal the great majority of ulcers within four to eight weeks.
| Drug | Notes |
|---|---|
| Omeprazole | The original and most widely used; several interactions including with clopidogrel |
| Esomeprazole | The isolated active form of omeprazole; somewhat more consistent acid suppression |
| Pantoprazole | Fewest drug interactions, which makes it useful in complex regimens |
| Lansoprazole | Comparable efficacy |
| Rabeprazole | Less dependent on genetic variation in metabolism |
Timing determines whether they work properly: take a proton pump inhibitor thirty to sixty minutes before a meal, because the drug only inhibits pumps that are actively secreting. Taken on an empty stomach at bedtime it works considerably less well, and this single point explains a substantial share of apparent treatment failures.
H2 blockers such as famotidine reduce acid less powerfully but act faster, and are useful for breakthrough symptoms and at night. Sucralfate works differently, forming a physical protective barrier over the ulcer surface, and is taken away from other medicines because it interferes with their absorption.
🧫 Eradicating the infection
Where H. pylori is present, eradicating it is what turns a recurring condition into a resolved one. Recurrence after successful eradication is uncommon.
Treatment combines a proton pump inhibitor with two or three antimicrobials for ten to fourteen days. The specific combination has shifted over the past decade because of resistance, and this is the key modern point.
| Regimen | Components | Position |
|---|---|---|
| Bismuth quadruple therapy | PPI, bismuth, tetracycline, metronidazole | Increasingly preferred first-line, particularly where clarithromycin resistance is high |
| Clarithromycin triple therapy | PPI, clarithromycin, amoxicillin or metronidazole | Formerly standard; success rates have fallen with resistance |
| Concomitant therapy | PPI, clarithromycin, amoxicillin, metronidazole together | Used where bismuth is unavailable |
| Levofloxacin-based | PPI, levofloxacin, amoxicillin | Usually reserved for second-line after a failed attempt |
Two points about these regimens matter practically. The full course must be completed, because partial treatment selects for resistant organisms and makes the next attempt harder. And azithromycin is not part of any standard regimen — despite being a macrolide like clarithromycin, it performs poorly against H. pylori and should not be substituted.
Side effects are common: metallic taste, nausea, diarrhoea and darkened stools with bismuth, which is harmless. Alcohol must be avoided with metronidazole. Discomfort during the course is expected and is not a reason to stop early.
✅ Confirming it worked
This step is skipped constantly and it should not be.
Eradication is confirmed with a urea breath test or stool antigen test at least four weeks after finishing antibiotics and two weeks after stopping the proton pump inhibitor. Testing earlier produces false negatives and creates false reassurance.
Confirmation matters because first-line therapy fails in a meaningful proportion of cases, and an untreated persisting infection continues to cause ulcers and continues to carry the long-term risk of gastric cancer. Where the first attempt fails, a second regimen using different antibiotics is used, guided by sensitivity testing where available.
💉 Ulcers caused by painkillers
NSAID-related ulcers are managed differently, and the growing share of ulcers they represent reflects an ageing population on long-term anti-inflammatory and antiplatelet drugs.
Stopping the drug is the first step where possible, alongside a proton pump inhibitor. Where it cannot be stopped — low-dose aspirin after a cardiac event, for instance — the ulcer is healed while continuing it under acid suppression.
Prevention is the more valuable intervention. People needing long-term NSAIDs who have additional risk factors should be co-prescribed a proton pump inhibitor. Risk factors include age over sixty-five, previous ulcer or bleeding, concurrent aspirin, anticoagulants, corticosteroids or SSRIs, and higher NSAID doses.
Misoprostol replaces the prostaglandins that NSAIDs suppress and prevents ulcers effectively, though diarrhoea limits its use, and it must never be taken in pregnancy because it causes uterine contractions.
Anyone taking regular anti-inflammatory drugs should also know that H. pylori and NSAIDs together multiply risk, which is why testing before starting long-term NSAID treatment is recommended in people with a history of ulcer disease.
⏳ Long-term acid suppression
Proton pump inhibitors are among the most prescribed drugs in the world, frequently continued for years without review, and questions about long-term safety deserve a measured answer rather than either dismissal or alarm.
Observational studies have linked prolonged use with fractures, kidney disease, low magnesium, vitamin B12 deficiency, certain intestinal infections and pneumonia. Most of these associations are modest, and studies of this design struggle to separate the effect of the drug from the effect of the conditions that led to it being prescribed. Randomised evidence has been considerably more reassuring.
The sensible position is that these drugs are genuinely valuable where indicated — healing ulcers, preventing NSAID-related bleeding, treating erosive reflux — and should be reviewed periodically rather than continued indefinitely by default. Where the reason for starting has resolved, stepping down to the lowest effective dose or stopping is appropriate, with an awareness that rebound acid secretion can cause a temporary worsening for a couple of weeks after stopping, which is not evidence that the drug is still needed.
🍽️ Diet, realistically
Elaborate ulcer diets were built on a theory of the disease that turned out to be wrong, and most of their restrictions have no supporting evidence.
Raw vegetables, fruit, nuts and mushrooms do not need to be avoided. Bland diets do not speed healing. Frequent small meals do not confer benefit and were originally recommended on reasoning that no longer applies.
What is supported is narrower and worth doing:
- Stop smoking — it impairs healing, raises recurrence and increases complication risk. This is the dietary and lifestyle measure that actually matters
- Limit alcohol, which irritates the mucosa directly
- Avoid individual foods that reliably cause you symptoms, which varies between people and is about comfort rather than healing
- Do not lie down soon after eating if reflux coexists
- Eat adequately. Weight loss from fear of eating is a genuine problem in this condition and does no good
✅ Why eradication is worth the unpleasant fortnight: beyond curing the ulcer, eradicating H. pylori substantially reduces the risk of gastric cancer, which the infection causes through decades of chronic inflammation. It is one of the few genuinely preventable cancers, and treatment takes two weeks.
📋 What to expect
An ulcer with an identified and treated cause heals reliably. Symptoms usually improve within days of starting acid suppression, and healing takes four to eight weeks. Where H. pylori was the cause and eradication is confirmed, recurrence is uncommon — a complete change from the pattern of endless relapse that defined this condition before the bacterium was identified.
Ulcers that recur after apparently adequate treatment prompt a specific set of questions: was eradication actually confirmed, are NSAIDs still being taken including over the counter, is smoking continuing, and is there a rarer cause such as Zollinger-Ellison syndrome or a malignancy. Gastric ulcers in particular are re-examined endoscopically to confirm healing, because a small proportion represent cancer rather than a benign ulcer.
The treatments discussed here are stocked in the gastrointestinal category, including Prilosec (omeprazole) and the other proton pump inhibitors used both for healing and as part of eradication therapy.
When an ulcer is caused by Helicobacter pylori, antibiotics are what stop it coming back. A typical course combines an acid reducer with amoxicillin and clarithromycin, such as Biaxin XL (clarithromycin), followed by a test to confirm the bacteria are gone.
❓ Frequently asked questions
Does stress cause stomach ulcers?
No. Everyday psychological stress may worsen symptoms and affect health behaviours, but it does not produce the lesion. The great majority of ulcers are caused by Helicobacter pylori infection or by anti-inflammatory painkillers. The stress ulcers described in medical literature occur in intensive care after major physiological insult such as severe burns or prolonged ventilation, which is a different phenomenon entirely.
Do I need to avoid spicy food?
Not for healing. Chilli can irritate an existing ulcer and cause symptoms, and there is some evidence that capsaicin is mildly protective rather than harmful. Avoiding foods that reliably cause you discomfort is reasonable for comfort, but it is not treatment and it does not speed healing. The elaborate ulcer diets excluding raw vegetables, fruit, nuts and mushrooms were built on a theory of the disease that turned out to be wrong.
Why must I stop omeprazole before an H pylori test?
Because acid suppression reduces the bacterial population below the detection threshold without eradicating it, producing a false negative. Proton pump inhibitors should be stopped for at least two weeks, and antibiotics or bismuth for four weeks, before a urea breath test or stool antigen test. Testing someone still taking a PPI and telling them they are negative is a routine error that sends people into another cycle of unexplained relapse.
When should I take a proton pump inhibitor?
Thirty to sixty minutes before a meal, most often breakfast. These drugs only block acid pumps that are actively secreting, and a meal is what activates them. Taken on an empty stomach or at bedtime without food, the same dose works considerably less well. This single point accounts for a substantial share of cases where the medication appears not to be working.
Can an ulcer be cured permanently?
Yes, where the cause is removed. If H. pylori was responsible and eradication is confirmed, recurrence is uncommon — a complete change from the endless relapse that characterised the condition before the bacterium was identified. If NSAIDs were responsible and they are stopped, the same applies. Acid suppression alone heals the ulcer without removing the cause, which is why ulcers treated that way come back.
Why is azithromycin not used against H pylori?
Because it performs poorly against this organism despite being a macrolide like clarithromycin, and it does not appear in any standard eradication regimen. Substituting it is a genuine error. Current regimens combine a proton pump inhibitor with bismuth, tetracycline and metronidazole, or with clarithromycin and amoxicillin, for ten to fourteen days, with bismuth quadruple therapy increasingly preferred as clarithromycin resistance rises.
Do I need a test after treatment?
Yes, and it is skipped far too often. Confirmation with a urea breath test or stool antigen test should be done at least four weeks after finishing antibiotics and two weeks after stopping the proton pump inhibitor. First-line therapy fails in a meaningful proportion of cases, and a persisting infection continues to cause ulcers and continues to carry a long-term risk of gastric cancer.
Can I have an ulcer with no symptoms?
Yes, and a large proportion cause nothing until they bleed or perforate. This is particularly true of ulcers caused by anti-inflammatory drugs, because those same drugs suppress the pain the ulcer would otherwise produce. Older people on long-term aspirin or ibuprofen are the group most likely to present with a serious complication as the first indication that anything was wrong.
What are the emergency warning signs?
Vomiting blood or material resembling coffee grounds, black tarry stools, and sudden severe abdominal pain with a rigid abdomen all require immediate emergency assessment — they indicate bleeding or perforation. Difficulty swallowing, persistent vomiting, unintended weight loss and iron deficiency anaemia require urgent endoscopy rather than another course of treatment.
Are long-term proton pump inhibitors dangerous?
The picture is less alarming than headlines suggest. Observational studies have linked prolonged use with fractures, kidney disease, low magnesium, B12 deficiency and certain infections, but these associations are mostly modest and such studies struggle to separate the drug from the conditions that prompted it. Randomised evidence has been more reassuring. The sensible approach is to use them where indicated and review periodically rather than continuing indefinitely by default.
I take aspirin for my heart. What should I do?
Do not stop it without discussing it with the prescriber, since stopping antiplatelet treatment after a cardiac event carries its own serious risk. The usual approach is to heal the ulcer while continuing the aspirin under proton pump inhibitor cover. Anyone on long-term aspirin or NSAIDs with additional risk factors — age over sixty-five, previous ulcer, anticoagulants, steroids or SSRIs — should be on a proton pump inhibitor preventively.
Does treating H pylori prevent stomach cancer?
It substantially reduces the risk. The infection causes gastric cancer through decades of chronic inflammation, and eradication interrupts that process, with the benefit greatest when treatment happens before advanced changes to the stomach lining have developed. It is one of the few genuinely preventable cancers, and the treatment takes two weeks — which is a reasonable trade for an unpleasant fortnight.
📑 Sources and editorial
- Maastricht and Houston consensus reports on the management of Helicobacter pylori infection
- American College of Gastroenterology guidelines on peptic ulcer disease and H. pylori treatment
- Marshall BJ and Warren JR — original work identifying Helicobacter pylori, Nobel Prize in Physiology or Medicine 2005
- Evidence reviews on NSAID-associated ulcer prevention with proton pump inhibitors and misoprostol
- Randomised and observational evidence on long-term proton pump inhibitor safety
- FDA prescribing information for omeprazole, esomeprazole, pantoprazole, famotidine, sucralfate and misoprostol
- Related products: gastrointestinal category
- RXshop Editorial Team — reviewed by Emily Chen, MD, MPH, Internal Medicine
Medical Disclaimer: The information in this article is for educational and informational purposes only and is not a substitute for professional medical advice, diagnosis, or treatment. Always seek guidance from a qualified healthcare provider with any questions you may have regarding a medical condition, and before starting, stopping or changing any medication.