E. coli Treatment Options: Medication and Lifestyle Tips

E. coli Treatment: Medication, Lifestyle Changes, and More

E. coli Treatment: Medication, Lifestyle Changes, and More
iStock (2); Getty Images
Most strains of E. coli (Escherichia coli), a group of bacteria that live in the gut, do not harm us and actually help our digestive system work properly. Others may cause infection, leading to stomach pain, diarrhea, and serious health issues.

Not all E. coli infections affect the body in the same way, so not all E. coli infections are treated the same way. Here are the most common and effective strategies for treating and preventing various E. coli–related illnesses.

Ask your doctor what type of E. coli treatment might be best for you.

Surprising Signs Your Gut Is Unhealthy — and What to Do About It

An unbalanced gut can throw off the health of your entire body, but the symptoms aren’t always obvious. Learn to recognize — and deal with — three especially sneaky signs.
Surprising Signs Your Gut Is Unhealthy — and What to Do About It

Medication

Depending on the type of E. coli infection you have, appropriate medications can vary. Some infections may resolve on their own. Antibiotics may be prescribed for some but can cause complications for others.

Urinary Tract Infections

A urinary tract infection (UTI) can happen when some strains of E. coli enter the urinary system. This is the most common infection caused by E. coli.

Doctors typically treat UTIs with a range of antibiotics, says Mahesh Polavarapu, MD, the medical director of emergency medicine at NewYork-Presbyterian Westchester in New York. Which antibiotic they prescribe depends on the type of infection and patient characteristics, he says.

UTIs are classified as uncomplicated if they are mild and happen in otherwise healthy women. These are typically treated with oral antibiotics for a short period of time, Dr. Polavarapu says. The infection is classified as complicated if it shows up in males, children, pregnant people, and people with a weakened immune system.

 “Complicated UTIs are treated for a longer period of time and may require IV antibiotics,” Polavarapu says.
Some antibiotics used to treat uncomplicated E. coli–associated UTIs include:

  • sulfamethoxazole and trimethoprim (Bactrim, Bactrim DS)
  • fosfomycin (Monurol)
  • nitrofurantoin (Furadantin, Macrobid, Macrodantin)
  • cephalexin (Biocef, Daxbia, Keflex, Keftab)
A one- to three-day course of antibiotics can successfully treat most UTIs, with symptoms subsiding after a few doses.

Some strains of E. coli, called extended-spectrum beta-lactamase (ESBL) E. coli, are resistant to many antibiotic treatments.

 In these cases, or those coupled with a kidney infection, your doctor may prescribe a fluoroquinolone. Medications in this class include:

  • ciprofloxacin (Cipro)
  • levofloxacin (Levaquin)

Ask your doctor about the potential side effects of fluoroquinolones. “The one that we ensure patients are aware of is the risk of tendinopathy, or tendon pain or reduced function without rupture, and tendon rupture,” Polavarapu says. “The more common side effects are gastrointestinal, like nausea, vomiting, diarrhea, and dyspepsia [indigestion].”

In severe UTI cases, you may be prescribed:

  • ceftriaxone (Ceftrisol Plus, Rocephin)
  • piperacillin-tazobactam (Zosyn)
  • carbapenems

E. coli–Related Traveler’s Diarrhea

Traveler’s diarrhea often happens when a person visits another country and is exposed to bacteria (most often a strain of E. coli called enterotoxigenic E. coli, or ETEC) through food or water with which their body is not familiar.

In addition to hydration, treatment may include antidiarrheal drugs such as loperamide (Imodium). This medication is not recommended for people who have a fever, have bloody stools, or are age 18 or younger.

A healthcare professional may prescribe antibiotics if you have three or more loose stools in an eight-hour period or severe symptoms, including fever, dehydration, or blood or mucus in the stools. Medications may include:

  • ciprofloxacin (Cipro)
  • levofloxacin (Levaquin)
  • azithromycin (Zithromax, Zmax)
  • rifaximin (Xifaxan)

Intestinal E. coli Infections

Some intestinal E. coli infections, such as those caused by Shiga toxin–producing E. coli, or STEC, do not require medication. Treating these cases with antibiotics may increase your risk of developing hemolytic uremic syndrome (HUS), a condition that damages the kidneys and can cause blood clots.

It’s also important not to treat STEC infections with over-the-counter antidiarrheal medication, which also can increase your risk of developing HUS.

 Antidiarrheal medication slows down the digestive system and may keep toxins in your body.

If you have a STEC infection, your doctor will monitor your symptoms. It’s important to drink fluids to prevent dehydration.

Hemolytic Uremic Syndrome

When HUS occurs, toxins destroy red blood cells, disrupting the kidneys’ filtering system, which can cause kidney failure.

HUS affects up to 22 percent of people with diarrhea from an E. coli infection, primarily children ages 5 and younger and adults ages 60 or older.

HUS requires prompt medical treatment, which may include fluid replacement, blood or platelet transfusion, and kidney dialysis.

Most people with HUS who receive appropriate, timely treatment recover fully, especially children. Some do have lasting kidney damage.

 In such cases, a healthcare professional may recommend medication to lower blood pressure and help prevent kidney damage.

When there are complications, HUS may be treated with a medication called eculizumab (Soliris). This helps prevent further blood vessel damage, but it requires a vaccination to prevent meningitis, a potential side effect.

Neonatal Meningitis

E. coli is the second-leading cause of neonatal bacterial meningitis, behind group B streptococcus (GBS). Neonatal bacterial meningitis occurs in just 3 out of every 10,000 full-term pregnancies. It does require treatment, with a death rate of 5 to 20 percent after treatment.

If neonatal meningitis is suspected, a healthcare professional will draw blood and perform a spinal tap (also called a lumbar puncture) to test spinal fluid for E. coli bacteria. If bacterial meningitis is confirmed, treatment includes fluids, rest, and antibiotics.

Medication may include:

  • ampicillin (Principen)
  • cefotaxime (Claforan)
  • gentamicin (Garamycin)

Other Conditions

E. coli may result in other infections that require treatment with medication. These include:

  • Bloodstream Infections These may happen when E. coli enters the bloodstream. In addition to IV therapy, medication to treat these infections may include cefepime and carbapenem.

  • Sepsis An E. coli infection can progress to this extreme bodily response, especially for people with chronic health conditions or those younger than 1 or age 65 or older. It requires immediate medical attention, which can include antibiotics, in addition to oxygen and IV fluids.

  • Abdominal Infections E. coli Infections These are a leading cause of peritonitis, the inflammation of the abdominal cavity. Medications used to treat these include ampicillin (Principen), cefotaxime (Claforan), ceftriaxone (Rocephin), and ertapenem (Invanz).

  • Prostate Infections Bacterial prostatitis, or an inflamed prostate, can be treated with antibiotics. Typical duration of antibiotic treatment is four to six weeks.

  • Pelvic Inflammatory Disease (PID) PID is most common among women younger than 35 and is often a complication of a sexually transmitted infection (STI). But E. coli infection can also cause PID.

    It typically is treated with antibiotics.

Lifestyle Changes

While preventive measures for E. coli infections are the same for everyone, pregnant women, newborns, children, the elderly, and individuals who have a compromised immune system have a higher risk of contracting a foodborne E. coli illness.

Ways to reduce your risk of E. coli infection include:

  • Wash your hands thoroughly.
  • Keep cooking surfaces clean and separate.
  • Cook food thoroughly.
  • Wash produce.
  • Chill warm or hot food promptly if you’re done eating or not eating it right away.
  • Avoid unpasteurized dairy and juices.
  • Don't swallow water when swimming.
Take certain precautions when going abroad to avoid contracting traveler’s diarrhea. Areas of Central and South America, Mexico, Africa, the Middle East, and South and Southeast Asia are considered high-risk destinations, with some risk in eastern Europe and a few Caribbean islands.

Precautions include avoiding:

  • Food from street vendors
  • Moist foods that are at room temperature, such as sauces
  • Unpasteurized dairy products
  • Raw or undercooked meat or seafood
  • Salads and unpeelable fruits, such as berries and grapes
  • Beverages that contain ice cubes
While the above tips are good for everyone, know that certain groups of people are more prone to developing traveler’s diarrhea. That includes people with diabetes, inflammatory bowel disease, liver disease, kidney disease, heart disease, or a weakened immune system. Individuals on acid blockers or antacids are also at an increased risk because the reduction in stomach acid can make it easier for bacteria such as E. coli to survive.

Graphic titled, E. coli prevention tips, illustrated points include wash hands thoroughly, cook food all the way through, rinse produce, keep cooking surfaces clean, refrigerate cooked food, don’t swallow pool water, and avoid unpasteurized dairy and
Everyday Health

Rehabilitation and Therapy

The following therapies can be done at home to aid recovery from an E. coli infection:

  • Stay hydrated. Drink plenty of clear liquids, including water and broths. Avoid caffeine and alcohol.
  • Get plenty of rest. Give your body a break so it can do its best to fend off the infection.
  • Temporarily adjust your diet. Although you can return to regular meals when you are feeling better, your symptoms may improve if you avoid dairy products and fatty, high-fiber, and highly seasoned foods at first.
Most healthy adults can completely recover from an E. coli infection after about a week.

It’s important to contact a medical professional if you have any of these symptoms:

  • A fever higher than 102 degrees F
  • Bloody stools or urine
  • Vomiting or diarrhea that lasts more than two days
  • Signs of dehydration, such as infrequent urination or dark urine
  • Signs of hemolytic uremic syndrome (infrequent urination, unexplained rashes or bruising, irritability, decreased awareness, loss of color in the cheeks, and fatigue)

Pain Management

Pain from E. coli infections can range from mild discomfort to more serious pain in your stomach and elsewhere.

Pain relievers such as acetaminophen and ibuprofen may ease cramps and discomfort from UTIs and gastrointestinal infections.

Anti-nausea medication, such as bismuth subsalicylate (Pepto-Bismol), may be appropriate for gastrointestinal issues, Polavarapu says.

“Other medications that relax gut muscles are available, but you should be seen by a healthcare professional to see if they are right for you,” he says.
Phenazopyridine could address the burning sensation of a UTI, Polavarapu says, though it will not reduce the infection itself.

The Takeaway

  • E. coli bacteria can help our bodies, but it also can cause diarrhea, stomach pain, and infections.
  • Many E. coli infections do not require treatment beyond rest and hydration and may resolve in a week. Some may also require antibiotic treatment.
  • Anti-diarrheal medications and antibiotics are not recommended for certain E. coli infections and can actually make them worse.
  • Contact your doctor if your symptoms include bloody diarrhea or urine, a high fever, or signs of severe dehydration.

Resources We Trust

Additional reporting by Joseph Bennington-Castro and Tony Stasiek

EDITORIAL SOURCES
Everyday Health follows strict sourcing guidelines to ensure the accuracy of its content, outlined in our editorial policy. We use only trustworthy sources, including peer-reviewed studies, board-certified medical experts, patients with lived experience, and information from top institutions.
Resources
  1. E. coli Infection. Cleveland Clinic. November 22, 2023.
  2. Treatment of E. coli Infection. Centers for Disease Control and Prevention. May 14, 2024.
  3. Escherichia coli Infections. Merck Manuals. July 2025.
  4. Sabih A et al. Complicated Urinary Tract Infection. StatPearls. December 7, 2024.
  5. Urinary Tract Infection (UTI). Mayo Clinic. September 26, 2025.
  6. About ESBL-producing Enterobacterales. Centers for Disease Control and Prevention. June 12, 2025.
  7. Traveler’s Diarrhea. Merck Manuals. July 2025.
  8. Myojin S et al. Interventions for Shiga toxin-producing Escherichia coli gastroenteritis and risk of hemolytic uremic syndrome: A population-based matched case control study. PLoS One. February 4, 2022.
  9. Urinary Tract Infection (UTI). Mayo Clinic. September 26, 2025.
  10. Hemolytic Uremic Syndrome. Cleveland Clinic. June 24, 2024.
  11. Hemolytic Uremic Syndrome: Diagnosis & Treatment. Mayo Clinic. September 12, 2025.
  12. Hemolytic Uremic Syndrome: Symptoms & Causes. Mayo Clinic. September 12, 2025.
  13. Neonatal Bacteria Meningitis. Merck Manuals. July 2025.
  14. Meningitis Infections in Infants and Children. American Academy of Pediatrics. July 31, 2023.
  15. Frescas B et al. Outcomes Associated With Empiric Cefepime for Bloodstream Infections Caused by Ceftriaxone-Resistant, Cefepime-Susceptible Escherichia Coli and Klebsiella Pneumoniae. International Journal of Antimicrobial Agents. February 18, 2023.
  16. Septicemia. Johns Hopkins Medicine.
  17. Kam-Tao Li P et al. ISPD Peritonitis Guideline Recommendations: 2022 Update on Prevention and Treatment. International Society for Peritoneal Dialysis. March 10, 2022.
  18. Prostatitis. Mayo Clinic. February 22, 2025.
  19. Pelvic Inflammatory Disease. Merck Manuals. October 2023.
  20. How to Prevent E. Coli Infection. Centers for Disease Control and Prevention. May 14, 2024.
  21. Traveler’s Diarrhea. Mayo Clinic. January 18, 2025.
  22. E. Coli: Diagnosis & Treatment. Mayo Clinic. October 1, 2022.
  23. E. Coli: Symptoms & Causes. Mayo Clinic. October 1, 2022.
  24. Symptoms of E. Coli Infection. Centers for Disease Control and Prevention. May 14, 2024.
  25. E. Coli. Mayo Clinic. October 1, 2022.
  26. Treatment for Bladder Infection in Adults. National Institute of Diabetes and Digestive and Kidney Diseases.
  27. Bismuth Subsalicylate (Oral Route). Mayo Clinic. July 1, 2025.
  28. Phenazopyridine (Oral Route). Mayo Clinic.
Natalia-Johnsen-bio

Natalia Johnsen, MD

Medical Reviewer

Natalia Johnsen, MD, is a triple board-certified physician in internal medicine, lifestyle medicine, and obesity medicine, practicing as an internist and consultant at the Vancouver Clinic in Vancouver, Washington.

Dr. Johnsen began her medical career as an ob-gyn in Russia before relocating to the United States in 2000. She completed her internal medicine internship at the University of Nevada and her residency at a Stanford-affiliated program in Santa Clara, California.

Deeply interested in the impact of lifestyle on both physical and mental health, Johnsen transitioned her focus toward prevention-based care after witnessing how many chronic conditions could be avoided or improved through lifestyle interventions. She became board-certified in lifestyle medicine in 2021 and further expanded her expertise by earning board certification in obesity medicine in 2025.

Johnsen is passionate about empowering patients with evidence-based tools to achieve sustainable health and long-term well-being.

Holly Pevzner

Holly Pevzner

Author

Holly Pevzner is a writer who specializes in health, nutrition, parenting, and pregnancy. She is currently a staff writer at Happiest Baby. Her work, including essays, columns, features, and more, spans a variety of publications, websites, and brands, such as EatingWell, Family Circle, Fisher-Price, Parents, Real Simple, and The Bump. Pevzner has written several monthly health columns, including for First for Women and Prevention magazines. She previously held senior staff positions at Prevention, Fitness, and Self magazines, covering medical health and psychology. She was also a contributing editor at Scholastic's Parent & Child magazine.