7 Causes of Flatulence and Mucus Discharge (Gastroenterologist Explains)

Our content is not intended nor recommended as a substitute for medical advice by your doctor. Use for informational purposes only.

1. Infection (Gastroenteritis and dysentery).

Infection is the most cause of ACUTE onset flatulence and mucus in stool.

Gut bugs such as viruses, bacteria, and protozoa may invade your small intestine and the colon causing digestive symptoms such as diarrhea with mucus discharge, abdominal pain, and flatulence.

Dysentery is a special form of digestive system infection that predominantly affects the colon and the rectum. Dysentery is often characterized by the passage of mucus only stools (mucus discharge), blood in stool, extreme urge to defecate, and  

Any infection can cause increased mucus in poop which can be white or colored (yellowish).

For Example:

  • Acute viral gastroenteritis (stomach flu).
  • Acute dysentery (can lead to mucus only poop).
  • Most types of foodborne illnesses (food poisoning).
  • Also, chronic causes of intestinal infections can lead to white mucus in poop.

Symptoms of acute viral gastroenteritis (stomach flu):

  • Most often, acute infections cause acute onset diarrhea with mucus discharge (loose or watery stool with mucus).
  • Abdominal pain (Belly pain).
  • Nausea or vomiting.
  • Lowgrade fever and body aches.
  • Chronic infections, prolonged mucus in stool, diarrhea, and abdominal pain are frequent symptoms.

Symptoms of Dysentery:

  • Severe, frequent attacks of diarrhea.
  • The diarrhea is mixed with mucus, blood, or both.
  • Extreme urgency to poop.
  • In severe cases, mucus discharge comes out without stool.
  • Abdominal pain.
  • Fever (it can be of high grade). 

2 . Lactose Intolerance.

Lactose is a type of sugar mainly present in milk and other dairy products.

Lactose intolerance is the most common form of food intolerance. Studies show that around 25% of the white race has lactose intolerance (reference).

Shockingly, lactose intolerance may affect up to 90% of other races such as blacks, Native Americans, and Asian Americans (reference).

If you are a regular consumer of mild or dairy products, lactose intolerance can be the cause of diarrhea, flatulence, and mucus discharge.

What causes lactose intolerance?

The lactose sugar needs an enzyme called (lactase) to be digested and absorbed. Lactose intolerance occurs when your small intestine cannot produce enough (lactase) (reference).

The lactase enzyme deficiency can be:

  • Primary lactase deficiency: is a hereditary disease leading to gradual loss of lactase enzyme function (most common cause).
  • Secondary lactase deficiency: due to injury to the intestinal mucosa as with gastroenteritis, celiac disease, IBD, chemotherapy, or antibiotic use.

Symptoms suggestive of lactose intolerance:

  • Diarrhea after eating ice cream and other dairy products.
  • Stomach pain.
  • Bloating and distension.
  • Passing too much gas (flatulence).
  • Nausea after eating dairy products.
  • Fullness and early satiety.
  • Vomiting can occur in severe cases.
  • Less commonly: Headache, muscle aches, joint pain, mouth ulcers, and impaired concentration (reference).

Lactose intolerance is a widespread condition. So, consider consulting your doctor if you consistently get so much gas all the time.

Also, you can run a small experiment by eliminating dairy for a week and notice the changes in gas amounts. Tell your doctor or nutritionist if cutting lactose improves your condition.

More: What happens if you ignore lactose intolerance?

3. Other forms of food intolerance and allergy.

Food intolerance occurs when your gut has trouble digesting or absorbing certain types of food or food component.

As a result, the undigested and/or unabsorbed foods remain longer inside your intestines.

Bacteria then consume the stagnant food and produce extra gas (even with average amounts of food).

The more you eat from the offending foods, the more you will get flatulence and other digestive symptoms such as diarrhea and mucus discharge.

Food intolerance is widespread, affecting up to 20% of people (reference).

Food intolerance is different from food allergy. Food allergy is defined as an allergic reaction to food (mediated by your immune system).

The differences between food intolerance and allergy are explained in the table below.

Food intoleranceFood allergy
Affects 15-20% of the populationAffects nearly 2-5% of adults
Difficulty digesting certain types of food (not immune-mediated allergy).An immune-mediated reaction to certain foods or food components.
Causes “recurrent acute” or “chronic” attacks of diarrhea, gas, flatulence, and mucus discharge.Usually causes acute attacks related to the ingestion of offending food.
Intestinal symptoms: diarrhea, extensive gas, bloating, distension (looking pregnant), and abdominal painIntestinal symptoms are the same
No extraintestinal symptomsExtraintestinal symptoms like rashes, urticaria, swollen lips or face, or severe life-threatening allergic reactions.
The severity of your symptoms is proportional to the amount you eat from the offending food.Even trace amounts of the offending food can produce severe symptoms.

Common offending foods:

  • Lactose intolerance (dairy products).
  • Fructose malabsorption.
  • Alcohol intolerance.
  • FODMAP intolerance (as with People with IBS).

Common offending foods: (examples)

  • Raw meat, seafood.
  • Nuts, peanut
  • Mustard.
  • Rice
  • Some vegetables and fruits

4. IBS (Irritable bowel syndrome).

Irritable bowel syndrome is a widespread condition that affects your digestive system. About 15% of people worldwide have IBS, and the majority of them don’t know they have IBS.

IBS is a group of digestive symptoms (such as abdominal pain changes in bowel habits) that comes and go over time.

Patients with Irritable bowel syndrome are often sensitive to a group of foods collectively called the FODMAPs (Fermentable oligo-, Di-, Monosaccharides, and polyols.

Characteristics and sources of common FODMAPs

  Sugar typeFoods containing
OOligo-saccharidesFructans, galactooligosaccharidesWheat, barley, rye, onion, leek, the white part of spring onion, garlic, shallots, artichokes, beetroot, fennel, peas, chicory, pistachio, cashews, legumes, lentils, and chickpeas
DDi-saccharidesLactoseMilk, custard, ice cream, and yogurt
MMono-saccharides“Free fructose” (fructose in excess of glucose)Apples, pears, mangoes, cherries, watermelon, asparagus, sugar snap peas, honey, high-fructose corn syrup
PPolyolsSorbitol, mannitol, maltitol, and xylitolApples, pears, apricots, cherries, nectarines, peaches, plums, watermelon, mushrooms, cauliflower, artificially sweetened chewing gum, and confectionery

Flatulence, bloating, and passage of mucus in the stool are persistent symptoms of IBS.

Symptoms of IBS:

  • Abdominal pain that is recurrent at least one day per week (for several months).
  • The pain improves or worsens after bowel movements.
  • The pain is associated with a change in stool form (becoming more loose or hard).
  • The pain is associated with a change in stool frequency (diarrhea or constipation).
  • All the symptoms come and go intermittently in attacks (including on and off diarrhea and mucus discharge).
  • Triggers are usually food and psychological stress.
  • Flatulence, particularly after consumption of a high-FODMAP food.
  • Mucus discharge is one of the features of IBS according to the manning criteria for IBS diagnosis.

To get diagnosed with IBS, Your doctor has to exclude other causes of abdominal pain, flatulence, and mucus discharge such as infection, IBD, and food intolerance.


  • There is no permanent cure for IBS, Treatments only decrease the frequency or the severity of attacks.
  • The main start of treatment is to stay on low FODMAP foods.
  • Avoiding gluten and high-gas foods also helps.
  • Other lifestyle modifications such as reducing stress, getting enough sleep, and drinking enough fluids also help.
  • Fiber supplements such as psyllium and other laxatives are helpful in people with constipation-predominant IBS.
  • Anti-diarrheal medicines such as loperamide.
  • A probiotic supplement may help in some cases.

5.  Celiac disease.

Celiac disease is a bad reaction of your digestive system to wheat, rye, and barley.

A protein called gluten is able to produce severe inflammation and destruction of the intestinal mucosa leading to symptoms.

Celiac disease is a significant cause of chronic digestive issues such as diarrhea, flatulence, and mucus discharge.

Severe forms of celiac disease lead to malabsorption of nutrients leading to problems such as anemia, skin rashes, and weight loss.


  • The usual age of onset is between 20-30 years of age. But it can occur in older ages up to 70 years.
  • Abdominal pain and bloating.
  • Constant diarrhea.
  • Diarrhea can also be intermittent or not present. Constipation can also occur.
  • Nausea and vomiting.
  • Weight loss.
  • Easy fatigue and iron deficiency anemia.
  • Itchy, blistery skin.
  • Osteoporosis and osteomalacia (body aches).

6. IBD (inflammatory bowel diseases).

Inflammatory bowel disease refers to 2 major conditions:

  • Crohn’s disease: Unexplained inflammation and ulceration at any part of your gut (from the mouth to the anorectum).
  • Ulcerative colitis: Unexplained inflammation and ulceration affecting the large intestine only (the colon and the retcum).

About 1.8 million U.S adults (0.9%) had inflammatory bowel disease according to the CDC.

symptoms of IBD:

  • Persistent or recurrent diarrhea.
  • Abdominal pain.
  • Blood or blood and mucus coming out with or without a stool.
  • Weight loss.
  • Generalized fatigue.
  • Fever may occur.
  • Loss of appetite.

Suspect IBD if you have a prolonged history of abdominal pain, mucus, constant diarrhea, and blood in stool without obvious cause.

The main differences between Crohn’s and ulcerative colitis are summarized in the below table.

TypeCrohn’s DiseaseUlcerative Colitis
1- SiteAny part of the GI tract (from the mouth to the anorectum)The colon and retcum.
2- LesionsDeeper, it can involve all the layers of the GI wall.Usually superficial (only in the innermost layer)
3-Predominant symptomCrampy abdominal painBloody diarrhea. (can be constant)
4- ComplicationsFistulas, abscess, intestinal obstructionhemorrhagic toxic megacolon.
5- Risk of colon cancerSlight increaseMarked increase

Ulcerative colitis and Crohn’s disease are major diseases that require medical care and follow-up.

If you have a long history of recurrent abdominal pain, constant diarrhea with blood, and mucus in stool, consult your doctor.

7. Other causes of flatulence and mucus discharge.

  • SIBO (small intestinal bacterial overgrowth),
  • Antibiotic-associated diarrhea (pseudomembranous colitis).
  • Intestinal obstruction.
  • Colorectal cancer.
  • Certain medications.
  • Radiation therapy to the intestine (radiation colitis).
  • Other malabsorption syndromes such as tropical sprue, Whipple’s disease.