How to Treat an Ulcer: Medications, Diet, and More

Most stomach ulcers heal within 4 to 8 weeks with the right combination of acid-suppressing medication and, when needed, antibiotics. Treatment depends on what caused the ulcer in the first place, which is almost always either a bacterial infection called H. pylori or regular use of anti-inflammatory painkillers like ibuprofen or aspirin. Getting the cause right matters because it determines which medications you need and how long you’ll take them.

Finding the Cause First

Before starting treatment, your doctor will want to know whether H. pylori is involved. The most common non-invasive tests are a breath test and a stool test, both of which detect signs of the bacteria without requiring a scope. The breath test has a sensitivity around 90%, meaning it catches nine out of ten infections. A stool antigen test performs similarly. If you need an upper endoscopy for other reasons (to visualize the ulcer or rule out something more serious), a rapid tissue test done during the procedure is about 95% sensitive.

This step isn’t optional. Treating the acid without clearing the infection is one of the most common reasons ulcers come back.

Treating an H. Pylori Infection

If H. pylori is present, you’ll take a combination of antibiotics alongside an acid-suppressing medication for 14 days. The current recommended first-line regimen is called bismuth quadruple therapy: a proton pump inhibitor (PPI) taken twice daily, plus three other medications taken multiple times a day for two weeks. One of those is bismuth, the active ingredient in Pepto-Bismol.

You may have heard of a simpler three-drug regimen that pairs a PPI with the antibiotic clarithromycin. This used to be the standard, but resistance to clarithromycin has become so widespread that eradication rates drop to roughly 30% in resistant strains. The American College of Gastroenterology now recommends against using that combination unless lab testing has confirmed the bacteria are sensitive to clarithromycin.

The two-week course can be rough. Nausea, metallic taste, and diarrhea are common side effects. Finishing every dose matters, though. Incomplete courses breed antibiotic resistance and make a second round harder. After treatment, your doctor will typically retest you at least four weeks later to confirm the infection is gone.

Acid-Suppressing Medication

Whether or not H. pylori is involved, reducing stomach acid is the core of ulcer treatment. PPIs are the most effective option. They shut down the acid-producing pumps in your stomach lining, giving the raw tissue time to heal. Most people take one once or twice daily.

Duodenal ulcers (in the first part of the small intestine) typically heal in about 4 weeks on PPI therapy. Gastric ulcers (in the stomach itself) take longer, generally around 8 weeks. Your doctor may schedule a follow-up endoscopy for gastric ulcers to confirm healing and rule out malignancy, since stomach cancer can sometimes mimic an ulcer.

H2 blockers are a less potent alternative. They work differently, blocking one of the signals that tells your stomach to produce acid. For an active duodenal ulcer, the typical dose is 40 mg once daily or 20 mg twice daily. For a gastric ulcer, it’s 40 mg once daily. H2 blockers are sometimes used when PPIs aren’t tolerated, but PPIs remain the stronger choice for healing.

Over-the-Counter Options

Antacids like calcium carbonate or magnesium hydroxide neutralize acid that’s already in your stomach. They work fast and can ease pain within minutes, but the relief is short-lived and they don’t heal the ulcer. Think of them as a bridge for symptom flare-ups. PPIs, by contrast, take a few days to reach full effect but provide sustained acid reduction that actually allows tissue repair.

When the Ulcer Is Caused by Painkillers

Nonsteroidal anti-inflammatory drugs (NSAIDs) like ibuprofen, naproxen, and aspirin damage the stomach’s protective lining, especially with regular use. The first step in treating an NSAID-induced ulcer is stopping the drug if possible, then starting acid-suppressing therapy.

If you can’t stop the NSAID because of a condition like chronic arthritis or heart disease requiring low-dose aspirin, PPI therapy is the recommended co-treatment. Taking a PPI alongside the NSAID reduces acid levels enough for the ulcer to heal even while the irritant continues.

For people with a history of bleeding ulcers who still need anti-inflammatory treatment, guidelines recommend switching to a selective COX-2 inhibitor combined with a PPI. COX-2 inhibitors are less damaging to the stomach lining than traditional NSAIDs. Elderly patients and those taking blood thinners or corticosteroids alongside NSAIDs are at especially high risk for recurrence and generally need ongoing PPI protection.

Mucosal Protective Agents

A medication called sucralfate takes a different approach. Rather than reducing acid, it forms a physical barrier over the ulcer crater. It binds to the damaged tissue and creates a thick, paste-like coating that shields the wound from acid, digestive enzymes, and bile. It also stimulates mucus production and promotes tissue growth factors that speed repair. Sucralfate is sometimes used alongside acid-suppressing drugs, particularly in specific clinical settings, though PPIs remain the primary treatment for most patients.

Diet and Lifestyle During Healing

No specific diet cures an ulcer, but what you eat and drink can influence how quickly you heal and how comfortable you are in the process. Alcohol directly damages the digestive lining and increases acid secretion. Smoking has a similar effect, inhibiting mucus and bicarbonate production, both of which are your stomach’s natural defenses. Cutting out both during treatment gives your medications the best chance of working.

Milk is worth addressing specifically. For decades, people believed milk soothed ulcers by coating the stomach. It does briefly buffer acid, but it also triggers a significant rebound in acid production, making things worse overall. It’s no longer recommended as a remedy.

During the recovery phase, your body has a greater need for protein and certain micronutrients. Zinc supports immune function and wound healing. Vitamin C may help with H. pylori eradication at moderate doses (up to 500 mg daily over several months showed benefit in studies). Selenium can reduce infection complications. A fiber-rich diet of 20 to 30 grams per day acts as a buffer against bile acids and reduces bloating and discomfort. Probiotics, particularly lactic acid bacteria, can lessen the side effects of antibiotic therapy and may shorten treatment time.

What Happens When Ulcers Don’t Heal

An ulcer that hasn’t healed after 8 to 12 weeks of standard PPI therapy is considered refractory. This happens in a minority of cases, but it requires attention. The first thing doctors evaluate is whether you’ve been taking your medication consistently, since missed doses are a common culprit. If adherence isn’t the issue, the next step is usually doubling the PPI dose or switching to a different PPI, then continuing for another 6 to 8 weeks.

Beyond medication issues, refractory ulcers prompt a search for other causes: persistent H. pylori infection that wasn’t fully eradicated, ongoing NSAID use (sometimes patients don’t realize certain over-the-counter products contain NSAIDs), or rarer conditions that cause excess acid production. A repeat endoscopy with biopsies is typically done to rule out cancer, especially for gastric ulcers that refuse to close.

Warning Signs of a Dangerous Complication

Most ulcers heal without drama, but two complications require emergency care: bleeding and perforation.

A bleeding ulcer can show up as vomiting blood (which may look bright red or like dark coffee grounds) or black, tarry stools. You might feel lightheaded, unusually tired, or short of breath, all signs of blood loss. These symptoms need immediate medical attention.

A perforated ulcer, where the ulcer burns completely through the stomach or intestinal wall, is unmistakable. The classic presentation is sudden, severe abdominal pain with a rapid heart rate and a rigid abdomen that’s painful to touch. In the first two hours, the pain is usually concentrated in the upper abdomen. Over the next several hours it spreads, worsens with any movement, and can progress to fever, abdominal swelling, and dangerously low blood pressure. Perforation requires urgent surgery, most often a repair procedure, though more extensive surgery may be needed for very large ulcers or suspected malignancy.