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

Not all E. coli infections impact 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.
Talk to your doctor about 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
“Uncomplicated UTIs are typically treated with oral antibiotics and for a short period of time,” Dr. Polavarapu says. “Complicated UTIs are treated for a longer period of time and may require IV antibiotics.”
- 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].”
In severe UTI cases, you may be prescribed:
- 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
- Bloodstream Infections These may occur 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 year old 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 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) Typically occurring in women under age 35, PID often is a complication of a sexually transmitted infection (STI) but can be the result of an E. coli infection. It typically is treated with antibiotics.
Lifestyle Changes
- Washing your hands thoroughly
- Keeping cooking surfaces clean and separate
- Cooking food thoroughly
- Washing produce
- Chilling warm or hot food promptly if you’re done eating or not eating it right away
- Avoiding unpasteurized dairy and juices
- Not swallowing water when swimming
Preventing E. Coli–Related Traveler’s Diarrhea
- 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, and avoid coffee, alcohol, and apple and pear juices.
- Get plenty of rest. Give your body a break so it can do its best fending 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.
- 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
“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.
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 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.
- Bush L et al. Escherichia coli Infections. Merck Manual. June 2024.
- Urinary Tract Infections in Adults. Urology Care Foundation. November 2022.
- Urinary Tract Infections Treatment and Diagnosis. Mayo Clinic. September 14, 2022.
- About ESBL-producing Enterobacterales. Centers for Disease Control and Prevention. April 11, 2024.
- Sabin A et al. Complicated Urinary Tract Infections. StatPearls. December 7, 2024.
- Kaye KS et al. Effect of Cefepime/Enmetazobactam vs Piperacillin/Tazobactam on Clinical Cure and Microbiological Eradication in Patients With Complicated Urinary Tract Infection or Acute Pyelonephritis. JAMA. October 4, 2022.
- Gotfried J. E. coli Gastroenteritis. Merck Manual. June 2023.
- Gotfried J. Traveler's diarrhea. Merck Manual. June 2023.
- 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.
- E. Coli. Mayo Clinic. October 1, 2022.
- Hemolytic Uremic Syndrome. Cleveland Clinic. June 24, 2024.
- Hemolytic Uremic Syndrome Diagnosis and Treatment. Mayo Clinic. September 8, 2023.
- Hemolytic Uremic Syndrome Symptoms and Causes. Mayo Clinic. September 8, 2023.
- Brenda L. Tesini. Neonatal Bacterial Meningitis. Merck Manual. July 2022.
- Meningitis Infections in Infants and Children. HealthyChildren.org. July 2023.
- Frescas BE 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.
- Li P K-T et al. ISPD peritonitis guideline recommendations: 2022 update on prevention and treatment. Peritoneal Dialysis International. March 10, 2022.
- Auwaerter PG et al. Ceftriaxone. Johns Hopkins Medicine. November 12, 2023.
- Prostatitis. Mayo Clinic. February 22, 2025.
- Bush L et al. Pelvic Inflammatory Disease (PID). Merck Manual. October 2023.
- How to Prevent E. coli Infection. Centers for Disease Control and Prevention. May 14, 2024.
- About Four Steps to Food Safety. Centers for Disease Control and Prevention. April 29, 2024.
- Traveler's Diarrhea. Mayo Clinic. January 18, 2025.
- E. Coli. Mayo Clinic. October 1, 2022.
- Symptoms of E. coli Infection. Centers for Disease Control and Prevention. May 14, 2024.
- Ibuprofen and acetaminophen (oral route). Mayo Clinic. February 28, 2025.
- Treatment for Bladder Infection in Adults. National Institute of Diabetes and Digestive and Kidney Diseases. April 2024.
- Phenazopyridine (oral route). Mayo Clinic. February 28, 2025.

Jane Yoon Scott, MD
Medical Reviewer
Jane Yoon Scott, MD, is an infectious disease physician and an assistant professor of medicine at Emory University in Atlanta. Dr. Scott enjoys connecting with her patients, empowering them to understand and take ownership of their health, and encouraging them to ask questions so that they can make informed and thoughtful decisions.
She graduated with the highest honors from the Georgia Institute of Technology, then received her MD from the Medical College of Georgia. She completed her internal medicine residency training and chief residency at Temple University Hospital, as well as a fellowship in infectious diseases at Emory University. She is board-certified in both internal medicine and infectious diseases.
When she is not seeing patients, Dr. Scott works with neighboring health departments to promote public health, especially to communities that have been historically underserved. She also teaches medical trainees and lectures medical students at the Emory University School of Medicine.
In her free time, Dr. Scott appreciates a good coffee shop, weekend hikes, playing guitar, strolling through cities, sampling restaurants, and traveling to new places.

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.