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

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
Next up video playing in 10 seconds
Medication
Urinary Tract Infections
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.
- sulfamethoxazole and trimethoprim (Bactrim, Bactrim DS)
- fosfomycin (Monurol)
- nitrofurantoin (Furadantin, Macrobid, Macrodantin)
- cephalexin (Biocef, Daxbia, Keflex, Keftab)
- 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].”
- ceftriaxone (Ceftrisol Plus, Rocephin)
- piperacillin-tazobactam (Zosyn)
- carbapenems
E. coli–Related Traveler’s Diarrhea
- ciprofloxacin (Cipro)
- levofloxacin (Levaquin)
- azithromycin (Zithromax, Zmax)
- rifaximin (Xifaxan)
Intestinal E. coli Infections
Hemolytic Uremic Syndrome
Neonatal Meningitis
- 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
- 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.
- 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
.png?sfvrsn=af62f23_5)
Rehabilitation and Therapy
- 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.
- 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
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
- Mayo Clinic: E. Coli: Diagnosis and Treatment
- Cleveland Clinic: E. Coli: Infection, Causes, Symptoms, and Treatment
- Centers for Disease Control and Prevention: E. Coli Infection Treatment
- MedlinePlus: E. Coli Infections
- New York Department of Health: Shiga Toxin-Producing E. Coli (STEC) Infections
Additional reporting by Joseph Bennington-Castro and Tony Stasiek
- E. coli Infection. Cleveland Clinic. November 22, 2023.
- Treatment of E. coli Infection. Centers for Disease Control and Prevention. May 14, 2024.
- Escherichia coli Infections. Merck Manuals. July 2025.
- Sabih A et al. Complicated Urinary Tract Infection. StatPearls. December 7, 2024.
- Urinary Tract Infection (UTI). Mayo Clinic. September 26, 2025.
- About ESBL-producing Enterobacterales. Centers for Disease Control and Prevention. June 12, 2025.
- Traveler’s Diarrhea. Merck Manuals. July 2025.
- 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.
- Urinary Tract Infection (UTI). Mayo Clinic. September 26, 2025.
- Hemolytic Uremic Syndrome. Cleveland Clinic. June 24, 2024.
- Hemolytic Uremic Syndrome: Diagnosis & Treatment. Mayo Clinic. September 12, 2025.
- Hemolytic Uremic Syndrome: Symptoms & Causes. Mayo Clinic. September 12, 2025.
- Neonatal Bacteria Meningitis. Merck Manuals. July 2025.
- Meningitis Infections in Infants and Children. American Academy of Pediatrics. July 31, 2023.
- 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.
- Septicemia. Johns Hopkins Medicine.
- Kam-Tao Li P et al. ISPD Peritonitis Guideline Recommendations: 2022 Update on Prevention and Treatment. International Society for Peritoneal Dialysis. March 10, 2022.
- Prostatitis. Mayo Clinic. February 22, 2025.
- Pelvic Inflammatory Disease. Merck Manuals. October 2023.
- How to Prevent E. Coli Infection. Centers for Disease Control and Prevention. May 14, 2024.
- Traveler’s Diarrhea. Mayo Clinic. January 18, 2025.
- E. Coli: Diagnosis & Treatment. Mayo Clinic. October 1, 2022.
- E. Coli: Symptoms & Causes. Mayo Clinic. October 1, 2022.
- Symptoms of E. Coli Infection. Centers for Disease Control and Prevention. May 14, 2024.
- E. Coli. Mayo Clinic. October 1, 2022.
- Treatment for Bladder Infection in Adults. National Institute of Diabetes and Digestive and Kidney Diseases.
- Bismuth Subsalicylate (Oral Route). Mayo Clinic. July 1, 2025.
- Phenazopyridine (Oral Route). Mayo Clinic.

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
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.