Ways to Prevent Migraine Headaches

Medically Reviewed by Murtaza Cassoobhoy, MD on February 13, 2023
7 min read

It's the best situation: Stop a migraine before it starts. To do that, your doctor may consider these types of prescription drugs.

Anticonvulsants. These are medicines that prevent or reduce seizures. Your doctor may recommend topiramate (Qudexy XR, Topamax) or valproic acid (Depakene, Depakote) to prevent headaches. Anti-seizure drugs could make you sleepy. You may also find it harder to focus.

Beta-blockers. These relax your blood vessels and slow your heart rate. They’re often prescribed to control blood pressure. For migraines, your doctor may suggest atenolol (Tenormin), metoprolol (Lopressor, Toprol XL), nadolol (Corgard), propranolol (Inderal, Inderal LA, Inderal XL, InnoPran), or timolol. Side effects may include feeling depressed and having problems during sex.

Botulinum toxin (Botox). A doctor can inject small amounts around your face and scalp every 3 months to keep migraines from happening. This treatment is approved only for people who have headaches at least 15 days a month. The more often you have migraines, the better Botox seems to help.

Calcium-channel blockers. These include diltiazem (Cardizem, Cartia, Tiazac) and verapamil (Calan, Covera HS, Verelan). They ease the narrowing of your blood vessels and are also given to treat heart disease. Side effects can include constipation and low blood pressure.

Antidepressants. Your doctor may prescribe tricyclic antidepressants (TCAs) like amitriptyline (Elavil) or nortriptyline (Aventyl, Pamelor). Some people gain weight and feel very tired when they take these. TCAs can also cause severe problems if you have heart disease or are pregnant. Research suggests that selective serotonin and norepinephrine reuptake inhibitors (SNRIs) such as duloxetine (Cymbalta) and venlafaxine (Effexor XR) may also help prevent migraines.

CGRP inhibitors. CGRP (calcitonin gene-related peptide) is a molecule involved in causing migraine pain. CGRP inhibitors are a new class of drugs that block the effects of CGRP. The ones approved to prevent migraine attacks that are taken by pill every day or every other day are atogepant (Qulipta) and rimegepant sulfate (Nurtec).

These are given as a shot or IV every month to every 3 months:

  • Eptinezumab (Vyepti)
  • Erenumab (Aimovig)
  • Fremanezumab (Ajovy)
  • Galcanezumab (Emgality)

Mild pain and redness at the site of the IV are the most common side effects. The long-term safety of CGRPs is unknown.

NSAIDs and triptans. If you're prone to migraines around your period, your doctor may have you take nonsteroidal anti-inflammatory drugs (NSAIDs), like naproxen (Anaprox, Naprosyn) or certain triptans, typically used to stop migraines once they've started, each month. You may be able to stave off an attack if you start a few days before your menstrual cycle starts and then stop a few days after your flow begins.

You may want to consider medicine to prevent migraines if you:

  • Have pain that hampers your life, despite treatment
  • Get more than four moderate to severe headaches per month
  • Take a lot of painkillers
  • Don't get enough relief from meds you now take
  • Have side effects from your headache drugs
  • Have uncommon migraine conditions like continuing aura (blurred vision or seeing spots or wavy lines)

Preventive medicine might not be right for you if:

  • You don’t get headaches often and they’re controlled by anti-inflammatories like ibuprofen and naproxen.
  • You have other health conditions such as asthma, diabetes, pancreatitis, or a liver problem like hepatitis.
  • The drugs could mix badly with other medicines you take.
  • You prefer treatments that don't involve meds.

If you can't take medication or prefer not to, you and your doctor could consider devices like:

  • Cefaly, a small headband device that sends electrical pulses through the forehead to stimulate a nerve linked with migraines
  • Spring TMS or eNeura sTM, a device for people who have an aura before migraine headaches. You hold it at the back of your head at the first sign of a headache, and it gives off a magnetic pulse that stimulates part of the brain.
  • Noninvasive vagus nerve stimulator (nVS) gammaCore, a hand-held device placed over the vagus nerve in the neck. It releases mild electrical stimulation to the nerve's fibers to relieve pain.
  • Nerivio, a wireless remote electrical device, for use at home, that changes nerve activity. You put it on your upper arm when a migraine headache starts.



Your headaches may ease up during your second and third trimesters.

If you have severe migraines, your doctor may suggest that you first try a treatment that's not a drug such as biofeedback, relaxation therapy, or stress management training. They may also recommend a preventive drug that has the lowest risk possible.

Talk to your doctor about the pros and cons of taking preventive medications for migraine. Together, you can decide the best approach for you.

Doctors will often start migraine treatment with the beta-blocker propranolol, the antidepressant amitriptyline, or the anti-seizure medication topiramate. About half of people will have half as many migraines once they're taking the right dose.

For any of these drugs to work, you'll need to follow your doctor's instructions. In most cases, that will mean taking medicine regularly. It could be up to 3 months before you start to notice a difference.

If you feel like a drug isn't working or has side effects that make you want to stop taking it, talk to your doctor. You may be able to get a different treatment that would be a better fit.

Migraine treatment can be costly. Experts put the cost of a year of care at about $6,575 per person. You may be able to get help to meet these expenses through one or more patient assistance programs (PAPs), which help to offer treatment free of charge or at a low cost if you qualify. You can ask your doctor about programs for which you may be eligible. The National Headache Foundation also has a list on its website.

Your everyday habits can go a long way to help you have fewer, less-severe migraines. Some things that may help include:

Supplements. Researchers have looked into a number of supplements to prevent or treat migraine. Some of them have shown promise, but we need more research to know for sure that they work. Vitamins can have side effects just as medications can, so be sure to talk to your doctor before trying any supplement, including vitamins and herbs, for your migraines.

Among the supplements that are currently being studied are:

Magnesium: While the studies so far have been small, early evidence shows that this mineral may cut down slightly on how often people have migraines. Researchers think it may help to slow down or block chemicals in the brain that transmit pain between nerve cells. Magnesium may prevent the narrowing of blood vessels that can cause pain. It may also block the wave of brain signals that can cause a migraine with aura. Some studies show that a daily dose of magnesium taken by mouth can prevent menstrual migraines.

But the amount of this mineral you need to take to prevent migraine is much higher than you’d take as a supplement: Up to 600 milligrams per day. Side effects can include an upset stomach, diarrhea, and sluggishness. In extreme cases, you may feel weak, have trouble breathing, and go into cardiac arrest. For these reasons, you should only take magnesium as a migraine treatment with the guidance of your doctor.

Vitamin B2 (riboflavin): In one very small study, more than half (56%) of those who took 400 milligrams of this nutrient for 12 weeks had fewer migraines, compared to 19% for the control group. A review of studies has found that B2 works about as well as valproic acid in easing migraine symptoms, but has almost no risk of side effects. But we need more research on larger groups of people to know just how effective B2 is for migraine.

Sleep. Go to bed and get up about the same time every day, including on weekends and holidays. When you hit the sack at random times or you get too much or too little shut-eye, that can trigger a headache.

Exercise regularly. You may be tempted to avoid being active, afraid it might trigger a migraine. Overdoing a workout may trigger a headache for some people, but research suggests regular, moderate aerobic exercise may make migraines shorter, less severe, and less frequent for many people. It also helps control stress, another trigger.

Eat regular meals. A drop in blood sugar can set off a migraine, so keep it steady by not skipping meals. Also, drink plenty of water to avoid dehydration, which can trigger the headaches.

Limit stress. Tension's a common trigger. So, take time each day to relax. You could:

  • Listen to calming music.
  • Take a short walk.
  • Meditate.
  • Do yoga.

Try complementary techniques. Along with your prescribed treatment, you might want to try one of these to help prevent migraines, such as:

Cognitive behavioral therapy (CBT). A highly effective way to manage migraine symptoms is to combine a medication plan and work with a mental health provider with experience in headache treatment. They’ll help you identify your personal triggers so you can steer clear of them when you can and manage your symptoms when you can’t. With this type of therapy, you can learn ways to manage both migraine pain and the emotional stress that often goes along with it, forming a vicious cycle.

CBT uses several techniques to help you do this. Through relaxation training, you’ll learn how to control your breathing and ease the muscle tension that leads to a headache. Stress management training gives you coping skills to help you stay calm when you’re stressed or in pain. With biofeedback, you’ll use electronic sensors to get information about your breathing, heart rate, brain waves, and more. Your therapist will help you practice ways to control some of these functions and your thought patterns so you can relax. Eventually, you’ll learn to do it without using the sensors.