How to Recover From a Stomach Infection Quickly

If you've ever had a stomach infection, you know it can be a miserable experience. Whether you're sick from food poisoning or another type of "stomach flu," a stomach infection can limit you from carrying out your daily activities.

The good news is that a stomach infection will usually go away within a few days, and the right self-care strategies can help you start feeling better quickly.

Woman sick in bed with a thermometer

Terry Doyle / Taxi / Getty Images

Types

There are different types of gastrointestinal infections. The three main ones are:

  • Viral
  • Bacterial
  • Parasitic

All of these infections cause what is called gastroenteritis—when there is inflammation of the stomach and intestines.

Viral Gastrointestinal Infections

Viral stomach infections are the most common of the three types and are usually what people mean by the "stomach flu." Various kinds of viruses can cause these infections, particularly a specific group known as noroviruses. Noroviruses are known to cause foodborne illnesses because of how easily the virus can spread through contaminated food and water.

Two other types of viruses—rotaviruses and adenoviruses—are common ones that cause stomach-related illnesses in infants and young children.

Bacterial Gastrointestinal Infections

Bacterial stomach infections are the second most common of the three and can be caused by several different types of bacteria. Some of the most common include:

Bacteria can be introduced into water and many foods, but some foods especially likely to become contaminated include:

  • Undercooked meats or eggs
  • Raw seafood
  • Raw fruits
  • Dairy products
  • Raw vegetables

Parasitic Gastrointestinal Infections

Parasitic stomach infections are the least common of the three types and are caused by two classes of parasites: helminths (worms) and protozoa. The most common parasites that invade the human stomach include:

Parasitic stomach infections are typically spread through contaminated water and feces, but can also spread through contaminated food as well. Although parasitic stomach infections are less prevalent in the United States, these infections have been a prevailing problem in developing countries.

Managing Symptoms

Bacterial, viral, and parasitic gastrointestinal infections can all have similar symptoms. These symptoms include:

  • Stomach pain/cramping
  • Diarrhea
  • Vomiting
  • Nausea
  • Fever
  • Body aches

Managing the symptoms of gastrointestinal infection not only can help you feel better, but it can be important for recovering effectively. If you don't manage them, it can raise your risk of developing ongoing digestive symptoms, a condition called post-infectious IBS (IBS-PI).

Three things you can do to help manage symptoms of a stomach infection include:

Let Yourself Vomit

Vomiting is part of the body’s own defenses against foreign invaders such as viruses and bacteria. So, though it's unpleasant, if you have the urge to vomit, don't try to prevent it.

However, vomiting also leads to losing fluids, so it is important to make sure you replenish those fluids as much as you can.

Stay Hydrated

When you have a stomach infection, getting dehydrated will worsen your symptoms—and it's dangerous to your health. Replacing those lost fluids is one of the best things you can do to feel better and recover faster. To rehydrate, try choosing clear liquids and drinks with electrolytes.

Avoid beverages such as soda and energy drinks, as they usually contain high amounts of sugar and/or caffeine, which can worsen diarrhea.

If it's difficult to keep fluids down, take very small but frequent sips or suck on ice chips. 

Eating the Right Foods

As your stomach begins to settle, gradually try bland foods that are easy to digest. Doing so can help alleviate diarrhea.

Some good choices are:

  • Soda crackers
  • Rice
  • Gelatin
  • Unbuttered toast
  • Potatoes
  • Bananas

Try to avoid:

  • Dairy products
  • Fatty foods
  • Sugary foods
  • Spicy foods
  • Alcohol

Self-Care

Treating your stomach infection means much more than just managing symptoms. There are certain lifestyle factors we tend to take for granted that can actually help in the recovery process. These factors include:

Getting Quality Rest

Many of us decide we are too busy to take the time to rest our bodies and sleep. However, getting proper sleep is important for overall well-being, especially when dealing with a stomach infection.

In fact, studies have shown that quality sleep can support the immune system to fight off infections like the stomach flu.

Managing Your Stress

Research has shown an association between chronic stress and increased susceptibility for developing viral infections.

Although you may have little control over the stressful events that pop up in your life, using active relaxation and stress management strategies can help reduce the effect that the outside stress has on your insides.

Being Optimistic

As far-fetched as it may seem, what you think can affect how you feel. Research suggests that those who are optimistic have lower risks of many poor health outcomes—and they're also able to cope better when they do become sick.

If you get ill, think positive thoughts about your illness and recovery. Talk to yourself like a loving parent, reassuring yourself that you will be “all better soon.” Being optimistic can help you cope with the unpleasantness of stomach flu while it runs its course.

When to See a Doctor

Sometimes, a stomach infection warrants a visit to the doctor. You should see your doctor right away if:

  • You have symptoms of dehydration, such as dry mouth, dark-colored urine, less frequent urination, or an increased feeling of thirstiness
  • You have a fever that is above 100.4 degrees F for more than a few days
  • You have diarrhea for more than two days
  • You have severe stomach or rectum pain
  • You see blackened or bloody stool
  • You experience sudden mental state changes, such as increased levels of irritability or a lack of energy and motivation

Medication

In most cases, stomach infections will get better on their own with time and self-care, but sometimes, medications may be needed. For any type of stomach infection, over-the-counter (OTC) medications can help treat irritating symptoms that aren't going away.

For instance, for those who experience diarrhea more than twice in one day, common OTC medications like Pepto-Bismol and Kaopectate may help.

If you have a fever or painful body aches, acetaminophen is a good OTC option. Unlike non-steroidal anti-inflammatory drugs (NSAIDs) such as Advil (ibuprofen), acetaminophen is safer for the stomach.

Your doctor may prescribe specific medications for bacterial and parasitic stomach infections. These prescriptions may include metronidazole, praziquantel, and albendazole for parasites, or azithromycin, ciprofloxacin, and tetracycline for bacteria. So, if your symptoms aren't getting better in a few days or are too bothersome, see your doctor, who can determine the cause and prescribe the right medication.

Frequently Asked Questions (FAQs)

How long does it take to get over a stomach infection?

How long an infection lasts can differ depending on the type of infection, but usually, stomach infections last anywhere from one to 14 days. Specific types of stomach infections may last longer, though. For example, symptoms of a giardia infection may last for up to six weeks or more.

How do I get over a bacterial stomach infection?

Like other types of stomach infections, bacterial stomach infections will usually resolve in time. However, managing symptoms effectively and taking over-the-counter medications when needed can help you feel better. Your doctor may also prescribe certain antibiotics to help get rid of the bacteria.

A Word From Verywell

You may be able to quickly recover from a stomach infection if you know what steps to take. Whether it be eating the right foods or properly managing your symptoms, each step you take can be important on the road to recovery. If you are dealing with symptoms that are severe or are not getting better, try visiting your doctor as soon as you can.

Was this page helpful?
Article Sources
Verywell Health uses only high-quality sources, including peer-reviewed studies, to support the facts within our articles. Read our editorial process to learn more about how we fact-check and keep our content accurate, reliable, and trustworthy.
  1. Medline Plus. Gastroenteritis. Updated April 23, 2021.

  2. MedlinePlus. Bacterial gastroenteritis. Updated June 9, 2021.

  3. Hechenbleikner EM, McQuade JA. Parasitic colitisClin Colon Rectal Surg. 2015;28(2):79-86. doi:10.1055/s-0035-1547335

  4. Saha L. Irritable bowel syndrome: pathogenesis, diagnosis, treatment, and evidence-based medicineWorld J Gastroenterol. 2014;20(22):6759–6773. doi:10.3748/wjg.v20.i22.6759

  5. National Institute of Diabetes and Digestive and Kidney Diseases. Symptoms & causes of viral gastroenteritis ("stomach flu"). Updated May 2018

  6. Besedovsky L, Lange T, Haack M. The sleep-immune crosstalk in health and disease. Physiol Rev. 2019;99(3):1325-1380. doi: 10.1152/physrev.00010.2018.

  7. Cohen S, Janicki-Deverts D, Doyle WJ, etc. Chronic stress, glucocorticoid receptor resistance, inflammation, and disease risk. Proceedings of the National Academy of Sciences. 2012;109(16):5995-5999. doi: 10.1073/pnas.1118355109

  8. Kim ES, Hagan KA, Grodstein F, DeMeo DL, De Vivo I, Kubzansky LD. Optimism and cause-specific mortality: a prospective cohort studyAm J Epidemiol. 2017;185(1):21-29.

  9. Cleveland Clinic. Fever. Reviewed December 31, 2019.

  10. National Center for Biotechnology Information. Antiparasitic drugs. Updated September 8, 2020.

  11. Malik OAA. Role of antimicrobials in the treatment of adult patients presenting to the emergency department with acute gastroenteritis - A mini review. Pak J Med Sci. 2017;33(2):488-492. doi:10.12669/pjms.332.11851

  12. Centers for Disease Control and Prevention. Parasites - Giardia. Reviewed February 26, 2021.