A plate of healthy food.

J ust about everyone experiences digestive problems on occasion. They’re some of the most common complaints in doctors’ offices. But for more than 10 million people, gas, bloating, constipation, diarrhea, or heartburn are a regular occurrence.

When your doctor can’t find an underlying reason for the problem, it’s dubbed a “functional” gastrointestinal disorder, meaning there’s no specific cause, which makes it even more frustrating to deal with. 

In many cases, though, there's a way to get some relief. “There can be many causes of these problems, but often, if we can’t point to one thing, altering the diet might help,” says Robert Hirten, M.D., an assistant professor of medicine and gastroenterology at the Icahn School of Medicine at Mount Sinai in New York City.

Though chronic digestive disruptions warrant a doctor’s attention (see “Is It Time to Call the Doctor?” below), “generally about 80 percent of patients will benefit from doing some sort of diet intervention,” says Melissa Phillips, R.D.N., a clinical nutritionist at the University of Wisconsin Health System’s Digestive Health Center.

The following strategies for what, when, and how to eat can keep your gastrointestinal tract in good working order.

Go Mediterranean

Your digestive system is teeming with healthy bacteria (think probiotics) and other microorganisms that aid in digestion as well as bolster your immunity and provide overall health benefits. 

more on gut health

A Mediterranean-style diet­—rich in fruits, vegetables, whole grains, legumes, olive oil, and nuts, with some fish, dairy, and lean meat—supplies fiber to feed beneficial bacteria. And olive oil contains antioxidant polyphenols that may help control inflammation.

“At this stage we aren’t able to recommend a specific diet to alter the microbiome in such a way that it directly prevents or helps a specific disease,” says Hirten. “But the food you eat can impact the inflammatory bacteria in your gastrointestinal tract.” A Mediterranean-style diet is also low in added sugars and processed foods, two factors that are important for a healthy gut, he says.

Increase Your Fiber

Even if you don’t switch to a Mediterranean diet, you should get plenty of fiber-rich foods—fruits, vegetables, whole grains, and legumes. Eating 25 to 30 grams of fiber a day can help normalize diarrhea and constipation, Hirten says.

There are two forms of fiber. Soluble fiber helps lower cholesterol and possibly blood sugar; sources include apples, oats, and legumes. Insoluble fiber helps bulk up stool and promotes the contractions in the intestines that propel it through your system; sources include whole wheat, popcorn, and green vegetables.

“If you’re constipated, add more insoluble fiber,” says Phillips. “If you have diarrhea, opt for more soluble fiber.” But incorporate fiber gradually into your diet. If you try to do it all at once, you might exacerbate your symptoms.

Drink Enough Water

Fiber absorbs water, making stool softer and easier to pass. If you’re dehydrated, fiber will be less effective and may cause more digestive symptoms. (Without adequate fluid intake, more fiber can actually be constipating.)

There’s no set guide­line for how much fluid to drink, but 8 cups a day is a safe goal for most people to aim for. Water, sparkling water, milk, juice, and noncaffeinated beverages count toward your daily intake amount, Phillips says, but water is the best. Sparkling water, milk, and juice can sometimes trigger bloating.

Add Natural Probiotics

Yogurt and other fermented foods such as sauerkraut, kefir, and miso may help populate your gut with healthy bacteria. There are no guidelines for how often to eat probiotic foods, but trying to incorporate them as part of an overall healthy diet could help.

Supplements that contain “live cultures” and strains of bacteria haven’t been shown to benefit digestion. (Some may not even make it past the stomach’s acidic environment.)

“I rarely recommend people start taking probiotic supplements, simply because we just don’t have enough evidence to suggest it helps or hurts,” says Meagan Bridges, R.D., a clinical dietitian and nutrition support specialist at the Uni­versity of Virginia Health System. “A lot of times, though, patients will have already been taking probiotic supplements, and some people find they do help their symptoms. If that’s the case, then I usually tell them to keep going. It’s patient-specific.”

Eat on a Schedule

Your digestive system prefers a routine. “It likes to know when you’re going to be eating and how much, so it knows when to work and when to rest,” says Bridges. “I tell my patients to try to eat at about the same time each day and the same amount of food.” Constant grazing or an erratic schedule can result in constipation.

In addition, avoid eating right before bed, which can lead to heartburn or indigestion. “Digestion slows down at night, and it takes longer for food to be absorbed,” says Bridges. “In my experience, those people who are consuming a lot at night aren’t eating much during the day, and that irregularity can contribute to irregular bowel movements.”

Slow Down at Meals

Digestion begins in the mouth, so thorough chewing sets the stage for the rest of the process. In addition, eating quickly or gulping down your food can make it easy to swallow air and lead to belching. If you’re having trouble with your teeth, see a dentist.

Check Your Supplements

Iron can cause constipation and magnesium can lead to diarrhea, Phillips says. In addition, some supplements as well as over-the-counter and prescription drugs can contain sorbitol or mannitol, sugar alcohols that may have a laxative effect or cause gas and bloating.

An Eating Plan for Tummy Troubles

For some people, even healthy foods—such as cauliflower, cashews, lentils, onions, peaches, and wheat—can cause gas, bloating, and discomfort. That's because foods like these contain hard-to-digest carbohydrates called fermentable oligo-, di-, and monosaccharides and polyols, aka FODMAPs. A 2016 study published in Clinical and Experimental Gas­tro­enterology found that a low-FODMAP diet may help irritable bowel syndrome (IBS) and may be particularly beneficial for people who have abdominal pain along with constipation or diarrhea.

Following a low-FODMAP diet, which involves eliminating these foods for two to six weeks, then slowly adding them back in small amounts, may help but should be done in consultation with a dietitian, says Melissa Phillips, R.D.N., of the University of Wisconsin Health System’s Digestive Health Center. “It’s meant to be a learning diet, not a permanent one. It helps people find and manage triggers and expand their diets in terms of foods that don’t cause problems.”

But before you start cutting out things, Robert Hirten, M.D., of the Icahn School of Medicine at Mount Sinai, recommends tracking what you eat and drink and your symptoms for a week. “It can give your doctor clues about potential triggers and make the connection between foods and symptoms much clearer for the patient, too,” he says.

Is It Time to Call the Doctor?

Occasional digestive upset is normal, but anytime you have symptoms that won’t go away, check with your doctor. And alert him or her immediately if you notice the following, which can signal a serious problem.

  • Bloody stools
  • Severe abdominal pain
  • Tender or swollen abdomen
  • Persistent nausea or vomiting
  • Fever
  • Diarrhea that lasts more than two days 

Editor’s Note: This article also appeared in the August 2019 issue of Consumer Reports On Health.