Most headaches are preventable with consistent daily habits. The major triggers are well established: dehydration, poor sleep, muscle tension, stress, dietary compounds, and screen time. Addressing even two or three of these can significantly reduce how often headaches show up.
Drink More Water, Consistently
Dehydration is one of the most common and most fixable headache triggers. When your body is low on fluid, the brain can temporarily contract, pulling away from the skull and producing pain. A pilot trial of 18 headache patients found that adding 1.5 liters of water per day (about six extra cups) over 12 weeks improved their symptoms compared to a placebo group.
The key isn’t just total volume but consistency. Drinking steadily throughout the day keeps your hydration stable. If you wait until you feel thirsty, you’re already mildly dehydrated. Coffee and alcohol both accelerate fluid loss, so if you drink either regularly, you’ll need to compensate with extra water.
Fix Your Sleep Schedule
Sleep quality has a moderately strong correlation with headache frequency. In a cross-sectional study of migraine patients, poor sleepers averaged about 17 headache attacks per month compared to roughly 12 for good sleepers. The people with the most frequent headaches consistently showed longer time falling asleep, shorter sleep duration, lower sleep efficiency, and more nighttime disturbances.
What matters most isn’t just getting enough hours. It’s keeping your schedule regular. Going to bed and waking up at the same time every day, including weekends, stabilizes your body’s internal clock. Irregular sleep is a well-documented trigger for both tension headaches and migraines. Aim for seven to eight hours, and prioritize falling asleep at a consistent time over sleeping in to “catch up.”
Watch What You Eat and Drink
Certain compounds in food are reliable headache triggers for susceptible people. Tyramine, found in aged cheese, red wine, smoked fish, chicken livers, and some beans, is one of the most common culprits. Nitrates, concentrated in processed meats like bacon, hot dogs, and salami, are another. These compounds affect blood vessel dilation and neurotransmitter activity in ways that can initiate a headache within hours of eating.
You don’t need to eliminate every potential trigger food at once. A better approach is keeping a simple food diary for a few weeks, noting what you ate before each headache. Patterns usually emerge quickly. Some people react to chocolate, citrus, or fermented foods, while others have no dietary triggers at all. The diary helps you target the actual problem rather than restricting your diet unnecessarily.
Keep Caffeine Below 200 mg Per Day
Caffeine has a complicated relationship with headaches. In small amounts it can relieve them, but regular intake above 200 mg per day (roughly two standard cups of coffee) sets you up for withdrawal headaches whenever your intake drops. According to the International Classification of Headache Disorders, caffeine-withdrawal headache develops within 24 hours of stopping regular consumption above that threshold.
The safest strategy is keeping your daily intake consistent and under 200 mg. If you currently drink more, taper gradually over a week or two rather than quitting abruptly. Sudden caffeine withdrawal is one of the most common causes of weekend headaches in people who drink coffee heavily on workdays and skip it on days off.
Correct Your Posture at Your Desk
Forward head posture, where your head juts ahead of your shoulders while you work, is a major driver of tension-type headaches. A clinical trial found that training people to correct this posture led to a nearly 50% reduction in headache activity. The study measured a specific neck angle and found that improvements in head position directly correlated with decreases in headache severity.
At your desk, your screen should sit at eye level so you’re not tilting your head forward or down. Your ears should align roughly over your shoulders when viewed from the side. If you catch yourself craning toward the screen, it’s a sign the monitor is too low or too far away. Strengthening the deep neck flexor muscles (the ones at the front of your neck) through gentle chin-tuck exercises can also help retrain your default posture over time.
Follow the 20-20-20 Rule for Screen Time
Digital eye strain is a growing source of headaches, especially for people who spend long hours on computers or phones. The 20-20-20 rule is a simple countermeasure: every 20 minutes, look at something 20 feet away for 20 seconds. This gives the muscles that focus your eyes a brief reset and reduces the cumulative strain that builds into a headache by late afternoon.
Beyond the 20-20-20 rule, reducing glare on your screen, improving ambient lighting so it roughly matches your screen brightness, and consciously blinking more often all help. People blink significantly less when staring at screens, which dries out the eyes and contributes to the headache-and-fatigue cycle of extended screen use.
Exercise Regularly at Moderate Intensity
Aerobic exercise is one of the best-supported headache prevention strategies. A systematic review found that exercising three to five times per week at moderate intensity for at least 30 to 45 minutes per session, sustained over 10 weeks or more, reduced migraine frequency. Most of the successful study protocols used activities like brisk walking, cycling, or jogging at 60 to 75% of maximum heart rate.
The benefits likely come from multiple pathways: exercise reduces stress hormones, improves sleep quality, and stabilizes blood vessel function. If you’re not currently active, start with brisk walking three times a week and build up gradually. One important caveat: intense exercise can occasionally trigger headaches in people who are prone to them, particularly if they skip a warmup or exercise while dehydrated. Moderate, consistent effort is more protective than occasional intense workouts.
Manage Stress Before It Builds
Stress doesn’t just feel like it causes headaches. It measurably increases tension in the forehead and neck muscles, which are the primary drivers of tension-type headaches. Biofeedback training, which teaches people to detect and reduce muscle tension in real time, has been studied extensively. A systematic review of the technique found that 10 out of the included studies showed significant improvement compared to control groups, with measurable reductions in headache intensity.
You don’t need a biofeedback device to get similar benefits. Progressive muscle relaxation, where you systematically tense and release muscle groups from your feet to your forehead, targets the same mechanism. Doing this for 10 to 15 minutes before bed or during a midday break can interrupt the tension cycle before it produces a headache. Breathing exercises, yoga, and even brief meditation sessions work through overlapping pathways. The most effective technique is whichever one you’ll actually do consistently.
Avoid Overusing Pain Medication
This is the headache prevention tip most people don’t know about. If you take over-the-counter painkillers more than two to three days per week, you risk developing medication overuse headache, sometimes called rebound headache. The painkiller relieves one headache but triggers the next one, creating a cycle that can transform occasional headaches into daily ones.
The thresholds are specific. For common painkillers like acetaminophen, ibuprofen, or naproxen, using them on more than 15 days per month puts you at risk. For combination medications containing caffeine, or for prescription migraine drugs like triptans, the threshold is lower: more than 10 days per month. The safest guideline from Harvard Health is to limit any as-needed headache medication to no more than two to three days per week, or fewer than 10 days per month total. If you find yourself reaching for painkillers more often than that, it’s a signal that a preventive approach is needed rather than a reactive one.
Consider Magnesium Supplementation
Among supplements studied for headache prevention, magnesium has the strongest evidence. Multiple studies have found that taking 600 mg of magnesium daily for 12 weeks reduces migraine frequency compared to placebo. Guideline recommendations from headache societies suggest a dose range of 200 to 600 mg per day, with various forms (oxide, citrate, glycinate) available over the counter.
Magnesium glycinate and citrate tend to be better tolerated than magnesium oxide, which can cause digestive discomfort at higher doses. Many people are mildly deficient in magnesium without knowing it, particularly if their diet is low in leafy greens, nuts, and whole grains. Correcting that deficiency alone may reduce headache frequency, even before considering any additional therapeutic effect.