What to Do About Stomach Ulcers: Causes and Treatment

Most stomach ulcers heal within 4 to 8 weeks with the right treatment, which almost always centers on reducing stomach acid and addressing the underlying cause. The two main culprits are a bacterial infection called H. pylori and regular use of pain relievers like ibuprofen or naproxen. Figuring out which one is driving your ulcer determines what you need to do next.

What Causes Most Stomach Ulcers

Stomach ulcers form when the protective lining of your stomach breaks down and acid eats into the tissue underneath. For decades, H. pylori infection was responsible for the majority of cases. That picture has shifted. In the U.S., only about 17% of peptic ulcers now test positive for H. pylori, meaning the majority are linked to other causes, primarily NSAIDs (nonsteroidal anti-inflammatory drugs) like ibuprofen, naproxen, and aspirin.

Smoking is another significant risk factor. It increases your chances of developing an ulcer, slows healing once you have one, and raises the likelihood of recurrence. The risk scales with the number of cigarettes you smoke per day. Alcohol is a strong promoter of acid secretion, though the evidence linking moderate drinking to ulcer development or delayed healing is less definitive. Still, limiting or stopping alcohol while you have an active ulcer is standard advice.

Getting the Right Diagnosis

Before treatment can start, your doctor needs to confirm the ulcer and check for H. pylori. The breath test is the most accurate noninvasive option, with a sensitivity around 92 to 94%. You swallow a small capsule or drink a solution, then breathe into a collection device. If H. pylori is present, the bacteria break down the substance and produce a gas the test detects. A stool antigen test is another option, with sensitivity around 83%. Blood antibody tests are less reliable (about 84% sensitivity) and can stay positive long after an infection has cleared, so they’re not ideal for confirming active infection.

If your symptoms are severe, you’re over 55, or there are red flags like unexplained weight loss or vomiting, an endoscopy lets the doctor look directly at the ulcer and take a tissue sample. In the UK, all patients diagnosed with a gastric ulcer are recommended to have a follow-up endoscopy within 12 weeks to confirm healing and rule out anything more serious.

How H. Pylori Ulcers Are Treated

If the infection is present, the goal is eradication. The standard approach is “triple therapy”: an acid-reducing medication taken twice daily alongside two antibiotics for 7 days. This combination heals more than 90% of H. pylori-associated ulcers. Some doctors prescribe an additional 2 to 4 weeks of acid-reducing medication after the antibiotics finish, but research shows the 7-day combo alone is equally effective for most people.

If your first round of treatment doesn’t clear the infection, a four-drug regimen called bismuth quadruple therapy is a common backup. Eradication rates with this approach sit around 78.6%, but adding a probiotic during treatment can push that to 85.5%. Not all probiotics work equally here. Only Saccharomyces boulardii (a yeast-based probiotic) and multi-strain formulations significantly improved eradication rates in clinical trials. Single-strain Lactobacillus or Bifidobacterium supplements showed no meaningful benefit. The timing matters too: probiotics only helped when taken alongside the antibiotics, not before or after the course.

A useful bonus of adding probiotics during treatment is that they cut side effects roughly in half. Diarrhea dropped by about 67% and nausea by about 71% in patients who took probiotics alongside their antibiotics.

How NSAID-Related Ulcers Are Treated

If your ulcer was caused by regular NSAID use, the first step is stopping the medication if possible. Treatment relies on acid-reducing drugs, and the timeline is longer than for H. pylori ulcers. Eight weeks of therapy works significantly better than four. In studies, patients on a standard dose saw healing rates jump from 67% at four weeks to 82 to 83% at eight weeks.

Proton pump inhibitors (PPIs) are the most effective class of acid-reducing medication for this purpose. H2 blockers (a different class of acid reducer) can also work, but PPIs generally heal ulcers faster and more reliably.

Managing Pain Without Making It Worse

If you have an active ulcer and still need pain relief for another condition, NSAIDs are the worst choice. They irritate the stomach lining directly and reduce the protective mucus your stomach produces. Acetaminophen (Tylenol) is the safest oral alternative. It doesn’t target inflammation the way NSAIDs do, so it may not fully address swollen joints, but it handles general pain without damaging the stomach lining.

Topical options are another route. Diclofenac gel, applied directly to the skin over a sore joint, provides localized relief. So little of it enters your bloodstream that it avoids the stomach-related risks of oral NSAIDs. Topical lidocaine patches can also help with localized pain. Beyond medications, physical therapy, exercise, heat or cold packs, massage, and weight loss (if relevant) all reduce pain and help you rely less on any pain reliever.

What to Eat During Recovery

There’s a persistent belief that you need a special “ulcer diet,” but the evidence doesn’t support it. The National Institute of Diabetes and Digestive and Kidney Diseases states directly that diet and nutrition don’t play an important role in causing, preventing, or treating peptic ulcers. Doctors do not recommend avoiding specific foods or following a particular eating plan for ulcer healing. If certain foods (spicy dishes, coffee, acidic fruits) seem to worsen your discomfort, it’s reasonable to cut back on them for comfort. But doing so won’t speed healing or slow it down.

Preventing Ulcers From Coming Back

Recurrence is common if the original cause isn’t fully addressed. For H. pylori ulcers, confirming that the bacteria are gone after treatment is critical. A follow-up breath test or stool test a few weeks after finishing antibiotics can verify eradication.

For NSAID-related ulcers, the most effective prevention is simply avoiding NSAIDs going forward. If you need them for a chronic condition like arthritis, your doctor may prescribe a daily acid-reducing medication to take alongside them as a protective measure. Use the lowest effective dose for the shortest time possible.

Quitting smoking makes a measurable difference. Smoking impairs ulcer healing and directly increases recurrence rates. Limiting alcohol to small amounts of diluted drinks, or stopping entirely, removes another source of excess acid production.

Signs That Need Immediate Attention

Most ulcers are manageable and not dangerous, but complications like bleeding or perforation (when the ulcer eats through the stomach wall) are medical emergencies. Go to an emergency room if you experience sudden, sharp abdominal pain, a rigid abdomen that hurts when touched, vomiting blood, or blood in your stool. Bloody stool from an ulcer often looks dark, tarry, and black rather than bright red. Symptoms of shock, including fainting, heavy sweating, or confusion, also warrant immediate care.