Preventive (also called prophylactic) treatment of migraine can be an important component of migraine management. The goals of preventive therapy are to reduce the frequency, painfulness, and/or duration of migraine attacks, and to increase the effectiveness of abortive therapy. Another reason to pursue prevention is to avoid medication overuse headache (MOH), otherwise known as rebound headache, which can arise from overuse of pain medications, and can result in chronic daily headache. Preventive treatments of migraine include medications, nutritional supplements, lifestyle alterations, and surgery. Prevention is recommended in those who have headaches more than two days a week, cannot tolerate the medications used to treat acute attacks, or those with severe attacks that are not easily controlled. 
Behavioral interventions.
Exercise for 15–20 minutes per day may be helpful for reducing the frequency of migraine attacks. Recommended lifestyle changes include stopping tobacco use and reducing behaviors that interfere with sleep. Diet, visualization, and self-hypnosis are also alternative treatments and prevention approaches. General dietary restriction has not been demonstrated to be an effective approach to treating migraine. Sexual activity has been reported by a proportion of males and females with migraine to relieve migraine pain significantly in some cases. CBT, relaxation training, and mindfulness have also been shown to have some effect on mitigating migraine frequency. 
Medications.
Preventive drugs are used to reduce the frequency, duration, and severity of migraine attacks. Because of frequent unpleasant and sometimes debilitating side effects, preventive drugs are only prescribed for those migraineurs whose quality of life is significantly adversely affected. The most commonly prescribed drugs for migraine prevention are beta-blockers, antidepressants, and anticonvulsants. The drugs are started at a low dose, which is gradually increased until therapeutic effects develop, the ceiling dose for the chosen drug is reached, or side effects become intolerable.
Preventive migraine medications are considered effective if they reduce the frequency or severity of the migraine attacks by at least 50%. Due to few medications being approved specifically for the preventative treatment of migraine headaches, many medications such as beta-blockers, anticonvulsive agents such as topiramate or sodium valproate, antidepressants such as amitriptyline and calcium channel blockers such as flunarizine are used off label for the preventative treatment of migraine headaches. Guidelines are fairly consistent in rating the anticonvulsants topiramate and divalproex/sodium valproate, and the beta blockers propranolol and metoprolol as having the highest level of evidence for first-line use for migraine prophylaxis in adults. Propranolol and topiramate have the best evidence in children; however, evidence only supports short-term benefit as of 2020.
The beta blocker timolol is also effective for migraine prevention and in reducing migraine attack frequency and severity. While beta blockers are often used for first-line treatment, other antihypertensives also have a proven efficiency in migraine prevention, namely the calcium channel blocker verapamil and the angiotensin receptor blocker candesartan.
Tentative evidence also supports the use of magnesium supplementation. Increasing dietary intake may be better. Recommendations regarding effectiveness varied for the anticonvulsants gabapentin and pregabalin. Frovatriptan is effective for prevention of menstrual migraine.
The antidepressants amitriptyline and venlafaxine are probably also effective. Angiotensin inhibition by either an angiotensin-converting enzyme inhibitor or angiotensin II receptor antagonist may reduce attacks.
Medications in the anti-calcitonin gene-related peptide, including eptinezumab, erenumab, fremanezumab, and galcanezumab, appear to decrease the frequency of migraines by one to two per month.
A 2006 review article by S. Modi and D. Lowder offers some general guidelines on when a physician should consider prescribing drugs for migraine prevention:
 ;templatestyles src="Template:Blockquote/styles.css" / ;
Preventive medication has to be taken on a daily basis, usually for a few weeks, before the effectiveness can be determined. Supervision by a neurologist is advisable. A large number of medications with varying modes of action can be used. Selection of a suitable medication for any particular patient is a matter of trial and error, since the effectiveness of individual medications varies widely from one patient to the next. Often preventive medications do not have to be taken indefinitely. Sometimes as little as six months of preventive therapy is enough to "break the headache cycle" and then they can be discontinued.
Drugs used to prevent migraine in the UK include: fremanezumab, eptinezumab, erenumab, galcanezumab, botulinium toxin A, topiramate. A meta-analysis suggested that all these drugs reduced the number of days people spent with migraine and that differences in effectiveness between these drugs were modest.
The most effective prescription medications include several drug classes.
Beta blockers.
The beta-blocker propranalol's effectiveness in headache treatment was a chance finding in patients receiving the drug for angina (chest pain due to a lack of blood to the heart muscle). The beta-blockers that are used in migraine treatment are propranolol, nadolol, timolol, metoprolol, and atenolol.
A meta-analysis found that propranolol had an "overall relative risk of response to treatment (here called the 'responder ratio')" was 1.94.
Adverse drug reactions (ADRs) associated with the use of beta blockers include: nausea, diarrhea, bronchospasm, dyspnea, cold extremities, exacerbation of Raynaud's syndrome, bradycardia, hypotension, heart failure, heart block, fatigue, dizziness, alopecia (hair loss), abnormal vision, hallucinations, insomnia, nightmares, sexual dysfunction, erectile dysfunction and/or alteration of glucose and lipid metabolism. Due to the high penetration across the blood–brain barrier, lipophilic beta blockers, such as propranolol and metoprolol, are more likely than other, less lipophilic, beta blockers to cause sleep disturbances, such as insomnia and vivid dreams and nightmares.
Anticonvulsants.
Anticonvulsants such as valproic acid and topiramate. A meta-analysis by the Cochrane Collaboration of ten randomized controlled trials or crossover studies, which together included 1341 patients, found anticonvulsants had an "2.4 times more likely to experience a 50% or greater reduction in frequency with anticonvulsants than with placebo" and a number needed to treat of 3.8. However, concerns have been raised about the marketing of gabapentin.
Neuromodulators.
Neuromodulators are also referred to as antidepressants when used to treat depression. Amitriptyline has been more frequently studied of the antidepressants and is the only antidepressant with fairly consistent support for efficacy in migraine prevention . The method of headache prevention with antidepressants is uncertain, but does not result from treating masked depression.
Tricyclic antidepressants (TCAs) such as amitriptyline and the newer selective serotonin reuptake inhibitors (SSRIs) such as fluoxetine are sometimes prescribed. TCAs have been found to be more effective than SSRIs. SSRIs are no more effective than placebo. Another meta-analysis found benefit from SSRIs among patients with migraine or tension headache; however, the effect of SSRIs on only migraines was not separately reported.
The main two side effects that occur from taking amitriptyline are drowsiness and a dry mouth. Other common side effects of using amitriptyline are mostly due to its anticholinergic activity, including: weight gain, changes in appetite, muscle stiffness, nausea, constipation, nervousness, dizziness, blurred vision, urinary retention, and changes in sexual function.
Anticonvulsants.
Anticonvulsant medication is commonly prescribed for migraine prevention, because they have been shown in placebo-controlled double-blind trials to be effective in some migraine sufferers.
Valproate acid.
Placebo controlled trials of both divalproex sodium and sodium valproate have shown them to be significantly better than placebo at reducing headache frequency. Nausea, vomiting, and gastrointestinal disturbances are the most common side-effects of valproate therapy, and are slightly less common with divalproex sodium than with sodium valproate. The results of a study on the long-term safety of divalproex sodium showed premature discontinuation of the drug in 36% of patients because of either drug intolerance or ineffectivity of the drug.
Topiramate.
Topiramate has been approved by the FDA for prevention of migraine. Studies have shown that it provides significant reductions in the frequency of migraine episodes in patients with 3-12 headaches a month. Adverse reactions related to topiramate treatment occurred in 82.5% of 328 subjects who took part in an extensive trial covering 46 different centres. Most commonly reported were paresthesia (28.8%), upper respiratory tract infection (13.8%, and fatigue (11.9%)
Topiramate has evidence in preventive treatment of chronic migraine.
Botulinum toxin.
Botulinum neurotoxin (Botox) injections have been approved in the US and UK for prevention of chronic migraine, but do not appear to work for episodic migraine. Several invasive surgical procedures are currently under investigation. One involves the surgical removal of specific muscles or the transection of specific cranial nerve branches in the area of one or more of four identified trigger points.
Botulinum toxin (Botox) has evidence in preventive treatment of chronic migraine. Botulinum toxin has been found to be useful in those with chronic migraine but not those with episodic ones. 
Gepants / Calcitonin gene-related peptide receptor antagonists.
The main types of CGRP antagonists used in the prevention of migraines are CGRP monoclonal antibodies and CGRP receptor antagonists (gepants). Zavegepant was approved for medical use in the United States in March 2023.
Calcitonin gene-related peptide receptor antagonists (CGRP) target calcitonin gene-related peptide or its receptor to prevent migraine headaches or reduce their severity. CGRP is a signaling molecule as well as a potent vasodilator that is involved in the development of a migraine headache. There are four injectable monoclonal antibodies that target CGRP or its receptor (eptinezumab, erenumab, fremanezumab, and galcanezumab) and the medications have demonstrated efficacy in the preventative treatment of episodic and chronic migraine headaches in phase III randomized clinical trials.
The anti-CGRP monoclonal antibody erenumab was found in one study to decrease chronic migraines by 2.4 days more than placebo.
Various herbal drugs.
Butterbur.
Native butterbur contains some carcinogenic compounds, but a purified version, Petadolex, does not. A systematic review of two trials totalling 293 patients (60 and 233 patients) showed "moderate evidence of effectiveness ... for a higher than the recommended dose of the proprietary Petasites root extract Petadolex in the prophylaxis of migraine."
Among several medicines studied in one analysis, butterbur had the best evidence (as assessed between 1999 and 2009) for its use. Unprocessed butterbur contains chemicals called pyrrolizidine alkaloids (PAs) which can cause liver damage, however there are versions that are PA free. In addition, butterbur may cause allergic reactions in people who are sensitive to plants such as ragweed.
Cannabis.
Cannabis was a standard treatment for migraine from 1874 to 1942. It has been reported to help people through an attack by relieving the nausea and dulling the head pain, as well as possibly preventing the headache completely when used as soon as possible after the onset of pre-migraine symptoms, such as aura.
The plant feverfew ("Tanacetum parthenium") is a traditional herbal remedy believed to reduce the frequency of migraine attacks. A number of clinical trials have been carried out to test this claim, but a 2004 review article concluded that the results have been contradictory and inconclusive.
Feverfew has traditionally been used as a treatment for fever, headache and migraine, women's conditions such as difficulties in labour and regulation of menstruation, relief of stomach ache, toothache and insect bites. During the last decades, it has mainly been used for headache and as a preventive treatment for migraine. The plant parts used for medicinal use are the dried leaves or the dried aerial parts. Several historical data supports feverfew's traditional medicinal uses. In addition, several clinical studies have been performed assessing the efficacy and safety of feverfew monotherapy in the prevention of migraine. The majority of the clinical trials favoured feverfew over placebo. The data also suggest that feverfew is associated with only mild and transient adverse effects. The frequency of migraine was positively affected after treatment with feverfew. Reduction of migraine severity was also reported after intake of feverfew and incidence of nausea and vomiting decreased significantly. No effect of feverfew was reported in one study.
Feverfew is registered as a traditional herbal medicine in the Nordic countries under the brand name Glitinum, only powdered feverfew is approved in the Herbal community monograph issued by European Medicines Agency (EMA).
Other medications.
A wide range of other pharmacological drugs have been evaluated to determine their efficacy in reducing the frequency or severity of migraine attacks. These drugs include beta-blockers, calcium antagonists, neurostabalizers, nonsteroidal anti-inflammatory drugs (NSAIDs), tricyclic antidepressants, selective serotonin reuptake inhibitors (SSRIs), other antidepressants, and other specialized drug therapies. The US Headache Consortium lists five drugs as having medium to high efficacy: amitriptyline, divalproex, timolol, propranolol and topiramate. Lower efficacy drugs listed include aspirin, atenolol, fenoprofen, flurbiprofen, fluoxetine, gabapentin, ketoprofen, metoprolol, nadolol, naproxen, nimodipine, verapamil and Botulinum A. Additionally, most antidepressants (tricyclic, SSRIs and others such as Bupropion) are listed as "clinically efficacious based on consensus of experience" without scientific support. Many of these drugs may give rise to undesirable side-effects, or may be efficacious in treating comorbid conditions, such as depression.
Medical devices.
Medical devices, such as biofeedback and neurostimulators, have some advantages in