Migraine attacks are more than bad headaches. They’re the result of highly complex processes that don’t work as well as they should. Scientists know some of them already and are starting to learn more about others. Among the most well-known is the link between migraine and estrogen. It explains why women are three times more likely to have migraine than men. It also shows why migraine attacks are more frequent and severe when estrogen dips before and during your period and menopause. But estrogen is just one piece of the puzzle.
Migraine has many causes, including certain genes and foods, along with changes in your brain and body. Growing evidence shows that bacteria in your gut put many of these changes in motion.
About the Microbiome
Your body is home to trillions of mostly friendly bacteria, viruses, fungi, and other microbes. Together, they’re called the microbiota or microbiome. These microbes are found in every part of your body, but the ones with the biggest impact live in your digestive tract. They play a role in nearly every aspect of your physical and mental health. Among their many functions, they:
- Oversee your brain’s growth in the first years of life
- Protect against harmful viruses, bacteria, and toxins
- Digest and absorb nutrients
- Make essential vitamins
- Control the immune response and inflammation in the brain
- Maintain the health and function of the gut lining
Gut bacteria are also closely tied to migraine. Nausea, vomiting, and sometimes diarrhea or constipation are common during migraine attacks. For some, nausea may be one of their most severe symptoms. In turn, people who have digestive problems are more likely to get migraine attacks. Serious digestive disorders such as inflammatory bowel disease, irritable bowel syndrome, and celiac disease are linked to migraine. According to some research, your chance of digestive problems goes up when your migraine attacks are more frequent or severe.
These connections happen because your brain and gut talk to each other. They shoot messages back and forth, like a text thread inside the body. If you’ve ever had a “gut feeling” or “gone with your gut,” you know this firsthand. The messaging network is called the gut-brain axis or the microbiome-gut-brain axis. It connects the central nervous system (CNS) — the brain and spinal cord — to the enteric nervous system (ENS) in the gut wall. For clear messaging, helpful gut microbes should be in much higher numbers than harmful ones. People who have migraine have too many harmful microbes, which may scramble the signals between the gut and brain.
What About Stress?
Many people who have migraine say stress is their main headache trigger. Whether stress directly causes migraine attacks isn’t clear. But research shows that stress can upset the microbiome by lowering the numbers and variety of helpful bacteria. This changes the signals sent to the brain, which can cause you to feel more stressed. The altered signals can also affect parts of your brain that make stress harder to handle. A landmark 2024 study found that people who have a greater number of ‘good’ gut microbes are more resilient during times of stress. A microbiome with too many ‘bad’ microbes can lead to a heightened stress response and even to anxiety and depression.
Sean Paul Spencer, MD, a gastroenterologist and physician-scientist at Stanford University, explains why. “Our gut can be thought of as having its own brain, with motor neurons, sensory neurons, and neurotransmitters,” he says. “In fact, our ‘gut brain’ contains more of some neurotransmitters, like serotonin, than the brain in our head. Increasing evidence is showing that bacteria in the gut, and the byproducts they produce, affect mood, cognition, and behavior.”
Hormones and Inflammatory Cytokines
Just as the gut and brain talk to each other, your immune system and endocrine system send signals back and forth. Immune cells release pro-inflammatory proteins called cytokines, like tumor necrosis factor and interleukins. Most of the time, inflammation is a good thing; it’s your body’s response to an injury or infection. Problems arise when inflammation goes on for too long. Cytokines also send messages to the endocrine system, which makes and regulates hormones. These include estrogen and cortisol, the main hormones your body produces when it’s under stress.
Cortisol and cytokines exist in what’s called a negative feedback loop. Negative here doesn’t mean bad. The feedback is meant to restore balance to the body. When this process works the way it should, cytokines signal part of the endocrine system called the hypothalamic-pituitary-adrenal axis (HPA) to release cortisol. In turn, cortisol tells cytokines to shut down inflammation when it’s no longer needed.
But when you have migraine, cortisol either ignores the message or isn’t up to the job. Some experts think chronic stress causes cortisol to stay high for so long that immune cells no longer respond to it. Here’s what goes wrong:
- Uncontrolled inflammation fires the trigeminal nerve, the main nerve that sends signals from your face to your brain.
- The nerve releases calcitonin gene-related peptide (CGRP), a protein that normally expands blood vessels to help manage blood pressure.
- If you have migraine, your body makes too much CGRP. This dilates blood vessels and worsens headache pain.
Niushin Zhang, Division Chief of Headache and Facial Pain and associate professor of neurology at Stanford University, says that while drugs that block CGRP are important migraine treatments, dilated blood vessels don’t cause migraines. “We now think of migraines more as a sensory integration disorder, rather than a vascular disorder,” she explains. In sensory integration disorder, the brain struggles to receive and process messages from your senses, such as sight, smell, hearing, and touch.
Metabolites, Leaky Gut, and Migraines
Metabolites are small molecules that serve as links between microbes and humans. Some help carry messages to the brain through the microbiome-gut-brain axis. All play a key role in health and disease.
Short-chain fatty acids (SCFAs) are some of the most well-known and best-studied metabolites. They include:
- Acetate
- Butyrate
- Propionate
They’re produced when bacteria in your colon break down carbs you can’t digest, such as unripe bananas and chickpeas. Butyrate is especially important because it helps regulate the gut’s immune system and protects the gut barrier.
This barrier is critical to your health. It consists of a layer of cells with a mucus layer underneath. The cells are bonded together by proteins called tight junctions. The mucus layer lets nutrients in but keeps harmful germs out. The cell barrier also helps what’s in the gut stay in the gut. But tight junctions can weaken from illness, poor diet, certain medicines, chronic stress, or an imbalanced microbiome. This allows toxins and bacteria to spill into the bloodstream, a problem called leaky gut. Leaky gut can cause inflammation throughout your body and has been linked by some experts to many chronic diseases. (Others aren’t so sure.)
The link to migraine isn’t as clear. It’s known that inflammation from leaky gut activates pain pathways. It also affects serotonin and other neurotransmitters and can make pain, including migraine pain, more intense.
Can We Cure Migraine?
It may not be possible to prevent all types of migraine, but it may be possible to effectively manage symptoms without drugs. The key is changing the health of your microbiome, mainly through the food you eat. Spencer and Zhang are both focused on improving gut health through healthy eating. As Spencer notes, “Diet is the most modifiable and accessible way for people to promote a healthier microbiome.”
Here’s what you can do:
- Focus on fiber. Most Americans fall far short of the recommended 28 grams of fiber a day. Yet fiber is what helps make SFCAs. You’ll find it in fruits, vegetables, nuts, seeds, legumes, and some whole grains. The Mediterranean diet is a great guide.
- Limit foods that cause inflammation, such as sweets, highly processed foods, and sugary drinks. Studies show they can disrupt healthy bacteria in the gut.
- Limit alcohol. It’s known to take a toll on the gut barrier.
- Choose healthy food over supplements. Many experts suggest probiotic supplements to help rebalance the microbiome, but Spencer thinks whole, unprocessed foods are a better option, as they offer nutrients and fiber that supplements don’t have. He also predicts a future when we will have psychobiotics — targeted microbiotic drugs that improve the gut-brain connection.
In the last few years, the microbiome has become a social media buzzword and a selling point for everything from shampoo and skin cream to dog treats and weight-loss supplements. It’s good that the spotlight is finally on the microbiome. But it would be a shame if its crucial role in health got lost in the current hype.

