If you have spent any time in the migraine community online, you have probably seen the McDonald's Coke and fries hack.
It is shared as a miracle. A trick. A reason your migraine cannot be that serious, because clearly fast food cures it.
That hack has added a lot of stigma to a disease that is already misunderstood. So I want to talk about what is actually happening when caffeine helps an attack, what is happening when caffeine causes one, and why both of those things can be true in the same brain.
Why Caffeine Can Stop a Migraine Attack
As you go through your day, your brain builds up a chemical called adenosine. The longer you are awake and the harder your brain is working, the more it accumulates. Adenosine binds to specific receptors in your brain and slowly makes your pain pathways more sensitive. This is part of why you feel more tired and more achy as the day goes on.
Caffeine blocks those adenosine receptors. It sits in the same parking spot adenosine wants to use, which keeps the pain signal from being amplified. This is the reason caffeine is an active ingredient in over the counter migraine medications like Excedrin. It actually works on the mechanism. Research has documented this dual role of caffeine in migraine for years, which is why the same molecule can show up as both a treatment and a trigger in the same conversation.
So when someone says caffeine aborted their attack, they are right.
Why Caffeine Can Also Cause One
Your brain adapts to regular caffeine use. When adenosine receptors keep getting blocked, your brain compensates by growing more of them. More receptors means more places for adenosine to land later.
So when caffeine clears out, even just a few hours later, all of those extra receptors are suddenly wide open. Adenosine floods in. The pain signal hits harder than it would have if you had never had caffeine in the first place. Your threshold drops. The cup gets fuller, faster.
This is what caffeine withdrawal actually is at a neurological level. The afternoon slump people brush off as needing more coffee is the same biological process. For a migraine brain, that drop can be enough to push the cup over the edge. Research has shown that for some people, simply stopping daily caffeine can improve how well their acute migraine medications work, which tells you how much chronic caffeine use can be shaping the underlying sensitivity.
The same molecule that blocked the pain pathway in the morning is the reason the pain pathway is more reactive by afternoon.
The Sleep Connection Most People Miss
This is the part that quietly causes more attacks than any individual cup of coffee. Caffeine has an average half life of approximately five hours, though this varies significantly from person to person, ranging from three to seven hours depending on genetics, medications, and other factors.
That 3pm coffee is still blocking adenosine at 8pm. Adenosine is the signal your brain uses to get into the deeper stages of sleep. Even when you fall asleep, the architecture of that sleep is disrupted because the chemical that should be telling your brain to go deeper is being held back. Research on caffeine and sleep found that caffeine consumed even hours before bed can meaningfully reduce sleep duration and quality.
Poor sleep lowers your migraine threshold. A lower threshold means tomorrow's cup starts fuller. That afternoon coffee did not cause an attack today. It quietly set up the conditions for one tomorrow.
If you have ever wondered why your sleep feels off even on nights when you fell asleep fine, your caffeine timing is one of the first places worth looking.
So Is Caffeine a Trigger or a Treatment?
The honest answer is that caffeine itself is rarely the real problem.
The problem is almost always inconsistency and timing. Different amount each day. Different time of day. Skipping it on weekends. Doubling up when you are tired. Drinking it late in the afternoon.
Your nervous system is highly sensitive to swings. Large changes in caffeine intake create the exact conditions that lower your threshold, withdrawal effects, sleep disruption, and a pain pathway that is more reactive than it needs to be.
Same amount, same time, every day, early enough that it is fully cleared before bed. That is what keeps your nervous system stable. Consistency matters more than the caffeine itself.
If You Want to Cut Back, Go Slow
If you have been reading this and thinking maybe you want to reduce your caffeine, please do not stop cold turkey. For a migraine brain, sudden caffeine withdrawal is one of the fastest ways to trigger a stretch of attacks.
Your nervous system needs time to scale back the extra adenosine receptors it built. That takes weeks, not days.
Some things that have helped me and the people in my community taper without losing days to attacks:
- Reduce by no more than 25mg per week. That is roughly a quarter of a typical cup of coffee. Slow enough that your nervous system has room to adjust.
- Keep the timing consistent while you reduce the amount. Same time every morning, just slightly less.
- Replace volume with decaf or half caf if drinking the cup itself is part of your routine. The ritual matters.
- Move your last caffeine of the day earlier before you reduce the total amount. Protect your sleep first.
- Track how you feel in your migraine diary. The whole point of going slow is to catch problems before they become full attacks.
- Do not start this in a high stress week, around your cycle, or during a barometric pressure swing. Pick a window where your baseline already has more space.
If you have tried to cut back before and ended up in a migraine spiral, the taper was probably too fast for your nervous system.
What I Want You to Take Away
Caffeine has been framed as both villain and miracle cure in the migraine world. Both framings miss what is actually happening.
It is a powerful neurological tool that interacts with the exact same receptor system that shapes your migraine threshold. Used consistently and timed well, it can be part of a stable baseline. Used inconsistently or too late in the day, it can quietly fill the cup before you even realize it.
The McDonald's Coke and fries hack works for some people in some moments because of the caffeine, the salt, and the rapid sugar. It is one acute intervention that sometimes helps, the same way an ice pack or a dark room sometimes helps. None of it is a cure. None of it changes what is happening underneath.
What changes things underneath is your baseline. Your sleep. Your meals. Your hydration. The patterns you keep day to day that decide how full your cup is when the next trigger arrives.
If you want to go deeper on the full framework for building a more stable baseline, including how caffeine fits into the bigger picture of sleep and nervous system regulation, I walk through it step by step in The 6 Steps I Used to Raise My Migraine Threshold.
Caffeine has been one of the most complicated things in my own migraine life. For a long time it felt like both my saviour and my saboteur, depending on the day. What changed it was understanding what was actually happening in my brain, instead of trying to follow rules someone else handed me.
Your relationship with caffeine is allowed to be complicated. It is allowed to change. And you are allowed to figure out what works for your nervous system, even if it looks nothing like the hack on your feed.
This blog post is for educational purposes only and is not medical advice. Please consult your healthcare provider about your personal migraine treatment plan.
Written by Deena Migliazzo
Migraine advocate, educator, and founder of The Migraine Network. Living with chronic migraine and dedicated to building community, education, and resources for others who get it.
Learn more about Deena


