How to Prevent Migraines

If you are prone to migraines, prevention can go a long way toward improving your quality of life. In addition to lifestyle modifications, this can include medications, complementary and alternative (CAM) treatments, and in some cases, even surgical approaches.

Given how debilitating they can be, preventing migraines is the goal of anyone who experiences them. But prevention strategies can be particularly important if your migraines tend to be severe or last for several days, or if your migraine medication produces intolerable side effects or proves ineffective for you.

Tips for Preventing Migraines
 Verywell / Brianna Gilmartin

Home Remedies and Lifestyle

They say that the best offense is a good defense, and that is very true with migraines. Migraines often have several triggers, many of which are tied to lifestyle, and avoiding them can often prevent an episode. The best aspect of this approach: It is side effect-free.

Keep in mind that not every lifestyle factor affects every person the same way. For example, certain foods and sounds can be major migraine triggers for some people, but they might not affect you at all.

Get Enough Sleep

Sleep deprivation is among the most common causes of migraine headaches. The Centers for Disease Control and Prevention (CDC) recommend seven hours or more of quality sleep per night for adults. But if falling and staying asleep is consistently difficult or you often snore or gasp for air, you may want to talk to your healthcare provider to rule out the possibility of a sleep disorder.

A handful of adjustments can be made to your sleep environment to address things that may disrupt your sleep. You may benefit from hanging blackout shades to prevent light from creeping in, or setting your thermostat to a cool, comfortable temperature. It may also help to avoid caffeine and alcohol late in the day or eating right before bed.

Many people find that creating a consistent routine at nighttime makes a world of difference. This may include turning the TV and other devices off an hour before bed, putting your phone in another room, and reading or listening to soft music instead. Do your best to stick to a sleep schedule that will ensure adequate Zzzzs.

Be Aware of Dietary Triggers

Some people get migraines after eating chocolate, soy products, nitrate-containing foods, monosodium glutamate (MSG), or food coloring. Because some food items contain multiple ingredients, it can be difficult to nail down which one is triggering your migraines.

If you experience migraines after consuming any type of food, write the incident down in a food diary to see if, over time, there is a pattern. Take note of the time you ate it and how much you consumed. Keeping a detailed food diary can be a useful part of an elimination diet. But this approach has its downsides as well; over time, an aggressive elimination diet could lead to nutritional deficiencies, so it's not recommended to pursue this approach for more than two weeks.

On the flip side, emerging research has pinpointed a few potential "migraine diets." In particular, the ketogenic diet has been proposed to decrease cGRP levels, oxidative stress, and inflammation in the brain, all of which are closely associated with migraines.Still, more studies are needed to prove that the keto diet is specifically beneficial for migraine management.

Steer Clear of Triggering Smells and Sounds

Strong scents like cleaning products and cosmetics can trigger a migraine, and prolonged exposure to fumes can provoke them as well. If avoiding those triggers is not possible, you may find relief by using a nose plug, wearing an N95 mask, or applying a dab of peppermint oil to your forehead or temples.

Loud noises and certain sounds are also known to trigger migraines in some people, but maintaining a quiet environment is often easier said than done. Studies have shown that setting aside time for silent meditation can significantly reduce the frequency and severity of migraine attacks.Consider stepping away for 10 minutes of meditation when your senses feel overwhelmed.

Keep in mind that holding a phone to your ear for a long time or wearing headphones can result in a migraine as well. You may find it beneficial to use a speaker when you have prolonged phone calls or a day full of remote meetings.

Manage Stress

Stress is a common trigger, and related migraines can occur both during and after a stressful situation.

Completely avoiding stressful situations is not realistic, but you can dedicate yourself to employing techniques that can help you better manage them. Exercising, journaling, engaging in a hobby—find what works best for you and carve out time for it every day. Make sure that you also schedule in some down time after particularly stressful events to decompress.

When you are stressed, know that doubling down on your attention to other triggers can also go a long way. For example, make sure you get plenty of sleep when you've hit a hectic patch at work.

Regulate Your Caffeine Intake

Caffeine is a component in some over-the-counter migraine medications such as Excedrin (acetaminophen, salicylic acid, caffeine). That's because caffeine can help control and prevent migraines. But for some people, ingesting caffeine actually induces migraines.

Caffeine is a vasoconstrictor (narrows the blood vessels), and migraine is associated with vasodilation. If your body becomes accustomed to caffeine-induced vasoconstriction, your natural vascular controls will adjust to that. It can take time (typically a few days) to adapt again when there's a change in your routine.

Typically, it's a change in your caffeine intake that affects migraines. For example, caffeine withdrawal can prompt an episode.

As is the case with most things, listen to your body. If you can tolerate some caffeine, it is best to keep your caffeine intake predictable and regular—both in amount and in timing.

If you notice, however, that caffeine consumption tends to trigger migraines, you might consider simply avoiding it altogether. Be aware that coffee, chocolate, cocoa, and tea all contain caffeine. 

Avoid Bright Lights

Bright lights can trigger a migraine or make symptoms worse during a migraine attack. If you sense that the lights around you are too bright, consider wearing sunglasses or dimming the lights when possible. 

Interestingly, light—specifically green light—may have therapeutic benefits, and light therapy has gained a lot of attention for its potential to prevent migraines. Although more research is needed to determine the efficacy of this therapy, replacing some light sources around the house with green light bulbs and "migraine lamps" may be an effective and inexpensive form of preventive care.

Regulate Your Body Temperature

Migraines have been associated with temperature changes, including exposure to cold and heat. You can try to control your environmental temperature or dress in a way that prevents you from getting too hot or too cold.

If you feel a migraine coming on, or if you know that you have been exposed to one of your migraine triggers, using an ice pack on your neck, shoulders or forehead can reduce your chances of developing a full-blown migraine. Alternatively, using a warm pad might do the trick.


If you have more than three to five migraines per month (or more than five days of migraine headaches per month), your healthcare provider may recommend that you take daily prescription medications for migraine prophylaxis (prevention).

Some of these medications are not formally indicated for migraine prophylaxis, but they are frequently used off-label for this purpose.

Over time, most people experience a fluctuation in the frequency and severity of migraines. You may need to use prescription migraine prophylaxis for years, or you may be able to discontinue it after a while when your migraines improve.

Keep in mind that medications used for migraine prophylaxis do not stop or reduce the pain of a migraine headache when you already have one. 

Migraine Healthcare Provider Discussion Guide

Get our printable guide for your next healthcare provider's appointment to help you ask the right questions.

Doctor Discussion Guide Man

Anti-cGRP Drugs

Calcitonin gene-related peptide (cGRP) inhibitors are a class of medications used for migraine prevention.

The following are approved by the Food and Drug Administration (FDA) for migraine prophylaxis.

  • Aimovig (erenumab), a monthly injection
  • Ajovy (fremanezumab), available as a 225 milligram (mg) monthly injection or a 675 mg quarterly (every three months) injection
  • Emgality (galcanezumab), a monthly injection
  • Vyepti (eptinezumab), an IV infusion administered once every three months
  • Nurtec ODT (rimegepant), the only anti-cGRP available in pill form (75 mg per dose), which is is taken once every other day

Treating Migraines in the Moment

Nurtec ODT is also approved to treat acute migraines, meaning migraines that have already started. It is the only medication available to both treat and prevent migraines.

These medications are antibodies that block the cGRP receptor, which is a pain receptor. cGRP may also cause vasodilation (widening of the arteries), which is believed to contribute to migraine symptoms. By blocking the action of cGRP, blood vessels may maintain their normal width.


Antidepressants are indicated for the treatment of depression. However, they are often used for migraine prevention as well.

When used for migraine prophylaxis, antidepressants are typically prescribed at a lower dose than recommended for the treatment of depression. These medications, including selective serotonin reuptake inhibitors (SSRIs) and tricyclic antidepressants, interact with neurotransmitters that mediate pain.

It can take up to four to six weeks of daily antidepressant use before you notice a decrease in the frequency and severity of your migraine headaches.


Several medications that are normally used for seizure control can reduce migraine frequency and severity when used on a daily basis.

These include:

Like antidepressants, these medications begin reducing the frequency and severity of migraines after about four to six weeks of daily use. 

Blood Pressure Medications

Daily use of low-dose antihypertensives can be effective in reducing the frequency of migraine headaches for some people. Two forms of antihypertensives are particularly noted for their ability to prevent migraines.

Since these medications lower blood pressure throughout the body, they are not recommended if you have low or borderline low blood pressure.

Non-Steroidal Anti-Inflammatories

While it is not common, prescription-strength anti-inflammatory medications are sometimes used for migraine prevention, particularly when inflammation is believed to be part of the cause. 


In general, when steroids are used for migraine prevention, they are used for a short period of time (one to two weeks).

In other conditions that cause headaches as a symptom, such as giant cell arteritis, a longer-term prescription for oral steroids may be used (six to 12 months), followed by a gradual reduction in dose.

Oral Contraceptives

Some women experience a decrease in the frequency and severity of migraine headaches when using oral contraceptives. This is more common for women who experience menstrual migraines, but some women with other migraine patterns benefit from using these drugs as well.

In some forms of migraine, mainly with migraine with aura, oral contraceptives are very controversial, given that there may be an increased risk of stroke. It is important to discuss the pros and cons of this treatment with your gynecologist as well as your neurologist.

Some formulations of oral contraceptives can cause migraines for some women, so be sure to mention new symptoms to your healthcare provider if you are taking birth control. A change may be necessary.

Specialist-Driven Procedures 

There are several procedures that are used to prevent migraine headaches. These are generally indicated if you have refractory migraines, which are migraines that don’t improve with preventive treatments or treatments that are usually used to stop a migraine.

If you experience intolerable side effects from medications, then you may experience better results from a procedure.

Botulinum Toxin Injections

Botulinum toxin injections are used as a preventive strategy for migraine headaches. The effect can last for several months, and treatment often needs to be repeated after a few months. Over time, most people can experience longer periods of improvement, and injections may be scheduled less frequently.

A healthcare provider places the injections under the skin and into the muscle in several locations on the head. Botulinum toxin is a muscle paralytic and this action is believed to help prevent migraines for some people.

Complementary and Alternative Medicine (CAM)

Several alternative therapies have been shown to help with migraine prevention. These strategies tend to be safe, but they may or may not work for you.


There are two ways that magnesium has been used for migraines: acutely at the time of the headache in IV form, or daily for preventive care in oral form.

Magnesium, used orally at a dose of 400 to 500 mg per day, has been shown to reduce the frequency and severity of migraines.

Even though you can get it over-the-counter, do not use magnesium for migraine prevention without your healthcare provider's approval, because it can interact with other medications.


A number of neuromodulation (nerve stimulation) devices have been approved for migraine prevention. These devices are placed externally on the head to produce vibrations that may help prevent migraines.

Cephaly is a small device that creates superficial nerve stimulation. It is placed on the forehead and turned on daily for 20 minutes to prevent migraines.

GammaCore is a handheld device that's held on the neck to stimulate the vagus nerve. It is used daily to prevent migraines. It was initially approved for migraine treatment and has also subsequently been approved for migraine prevention as well.

Additionally, a remote neuromodulation (REN) device titled Nerivio Migra has demonstrated effective therapeutic relief from migraine pain in clinical trials. The device is worn on the upper arm for 45 minutes at a time and remote controlled through a smartphone app. Stimulating sensory fibers in this part of the arm has shown to be effective in modulating the sensation of pain.


Acupuncture may be as impactful as daily meditation when used for migraine prevention. Research studies that have reported the benefits of acupuncture for migraine prevention generally involved treatments ranging from several times per week to several times per month.

It can be hard to know the number and frequency of acupuncture sessions that it might take for you to see benefits, so talk to your healthcare provider and acupuncturist if you are planning to use this approach for migraine prevention.


Biofeedback training has been found to be a valuable method of migraine prevention, potentially because it can help you find effective ways to cope with stress. The technique teaches people to recognize and alter physical responses that are not usually under voluntary control, such as blood pressure, breathing, and heart rate.

In a typical biofeedback session, a therapist will attach electrical sensors to specific parts of your body depending on what is being measured. Next, your therapist will walk you through a variety of mental exercises and relaxation techniques while a special measurement device records your physical responses.

One biofeedback session usually takes 30 to 60 minutes, and can be a valuable tool for uncovering how and when migraine triggers activate your body's "fight-or-flight" response.

Meditation, Yoga, Tai Chi

These exercises, which are based on physical and cognitive control and awareness, have been found to be effective in reducing the frequency and severity of migraine headaches. Some research also shows that using yoga as a complementary therapy may increase the effectiveness of other preventive migraine medications or reduce the amount that a person needs to take.

Frequently Asked Questions

  • What are the four phases of a migraine attack?

    You may experience four phases when going through a migraine:

    • Prodome phase, which can happen several hours before the migraine, causing symptoms like mood changes or fatigue
    • Aura phase, which includes visual disturbances like blurry vision, flashing lights, or vision loss
    • Headache phase, which can last from several hours up to three days
    • Postdrome phase, which happens after the headache, and may include body aches and trouble concentrating
  • How can you prevent an oncoming migraine?

    You may be able to prevent a migraine if you recognize the early signs in the prodome or aura phases. If you know when a migraine is coming, you can treat your migraine early to help reduce or stop symptoms. This can include taking medication, minimizing triggers, getting enough sleep, and reducing stress.

19 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. U.S. National Library of Medicine. Medline Plus. Migraine.

  2. CDC. How much sleep do I need? Sleep and sleep disorders.

  3. Gazerani P. Migraine and dietNutrients. 2020 Jun;12(6):1658. doi:10.3390/nu12061658

  4. Martins B, Costa A. Migraine improvement during covid‐19 pandemic – a case report on the wonders of a maskHeadache. 2020 Sep;60(10):2608-2609. doi:10.1111/head.13964

  5. Gu Q, Hou J-C, Fang X-M. Mindfulness meditation for primary headache pain: a meta-analysisChinese Medical Journal. 2018 Apr;131(7):829-838. doi:10.4103/0366-6999.228242

  6. Lee MJ, Choi HA, Choi H, Chung CS. Caffeine discontinuation improves acute migraine treatment: a prospective clinic-based studyJ Headache Pain. 2016 Dec;17(1):71. doi:10.1186/s10194-016-0662-5

  7. Horváth C. Alterations in brain temperatures as a possible cause of migraine headache. Med Hypotheses. 2014 May;82(5):529-34. doi:10.1016/j.mehy.2014.02.004

  8. Tanik N, Saçmaci H, Aktürk T. The relationship between exposure to hot/cold weather and the clinical features of headaches in patients with migraine and tension-type headaches. Neurol Res. 2020 Feb;42(3):239-243. doi:10.1080/01616412.2020.1723300

  9. U.S. Food & Drug Administration. New drug class employs novel mechanism for migraine treatment and prevention.

  10. NURTEC ODT (rimegepant). Full prescribing information.

  11. U.S. Department of Health & Human Services. Office on Women's Health. How are migraines treated?

  12. Herd CP, Tomlinson CL, Rick C, et al. Botulinum toxins for the prevention of migraine in adults. Cochrane Database Syst Rev. 2018 Jun;6:CD011616. doi:10.1002/14651858.CD011616.pub2.

  13. Dolati S, Rikhtegar R, Mehdizadeh A, Yousefi M. The role of magnesium in pathophysiology and migraine treatment. Biol Trace Elem Res. 2020 Nov;196(2):375-383. doi:10.1007/s12011-019-01931-z

  14. Yarnitsky D, Dodick DW, Grosberg BM, et al. Remote electrical neuromodulation (REN) relieves acute migraine: A randomized, double-blind, placebo-controlled, multicenter trialHeadache. 2019 May;59(8):1240-1252. doi:10.1111/head.13551

  15. Da silva AN. Acupuncture for migraine prevention. Headache. 2015 Feb;55(3):470-3. doi:10.1111/head.12525

  16. Stubberud A, Varkey E, Mccrory DC, Pedersen SA, Linde M. Biofeedback as prophylaxis for pediatric migraine: A meta-analysis. Pediatrics. 2016 Aug;138(2). doi:10.1542/peds.2016-0675

  17. Vasudha MS, Manjunath NK, Nagendra HR. Changes in MIDAS, Perceived stress, frontalis muscle activity and non-steroidal anti-inflammatory drugs usage in patients with migraine headache without aura following ayurveda and yoga compared to controls: An open labeled non-randomized study. Ann Neurosci. 2018 Apr;25(4):250-260. doi:10.1159/000492269

  18. Kumar A, Bhatia R, Sharma G, et al. Effect of yoga as add-on therapy in migraine (Contain): A randomized clinical trialNeurology. 2020 May;94(21):2203-2212. doi:10.1212/WNL.0000000000009473

  19. American Migraine Foundation. The timeline of a migraine attack.

By Heidi Moawad, MD
Heidi Moawad is a neurologist and expert in the field of brain health and neurological disorders. Dr. Moawad regularly writes and edits health and career content for medical books and publications.