When it comes to migraine prevention, what you eat certainly can help—or hurt. Anyone who suffers from these debilitating headaches (and that includes 38 million people in the U.S.) has likely tried to figure out how they react to certain foods. And they've probably received plenty of advice from well-wishers, too.

Now, a new two-part scientific review has examined more than 180 studies on the topic, and come up with some of the most comprehensive advice out there. The authors conclude that there are two main ways to manage headaches with diet—and that, for many people, these strategies can make a big difference.

The first, says lead author Vincent Martin, M.D., co-director of the Headache and Facial Pain Center at the University of Cincinnati, is to avoid specific foods or ingredients known to trigger migraines. These include caffeine, monosodium glutamate (MSG), nitrites, and excessive alcohol.

Yes, you read that right: caffeine. But before you quit cold turkey on your morning cup of joe (as if that’s even a possibility), know that not getting enough caffeine—as in the case of sudden withdrawal—has also been shown to be a migraine trigger.

"Let’s say you regularly pound down three or four cups of coffee every morning and you decide to skip your morning routine one day, you will likely have full-fledged caffeine withdrawal headache that day,” Dr. Martin said in a press release.

Rather, moderation is key. Dr. Martin recommends having no more than 400 milligrams of caffeine a day—that’s about three 8-ounce cups. "Large amounts of caffeine can bring on anxiety and depressive symptoms as well as headaches,” he adds.

MSG, a flavor enhancer used in frozen or canned foods, soups, salad dressings and sauces, and ethnic cuisine (especially Chinese cooking), is also a commonly cited migraine trigger. The review found that the additive seemed to be the most headache-inducing when it was dissolved in liquids, such as soups, rather than added to solid foods.

Despite its widespread use, Dr. Martin says it’s not too difficult to avoid MSG. "You eliminate it by eating fewer processed foods,” he says. "You eat more natural things such as fresh vegetables, fresh fruits, and fresh meats.”

One study included in the review singled out nitrites—preservatives in processed meats such as bacon, sausage, ham, and cold cuts—as a migraine trigger for about 5 percent of participants. These chemicals aren't used as often as they used to be, the authors note, but it’s still helpful to check food labels if you think you may be at risk.

And finally, says Dr. Martin, watch what you drink. Any type (or any amount) of alcohol can trigger headaches for some people, but the review found that vodka and red wine tend to cause the most problems.

Perhaps the review’s most surprising findings were the foods that didn’t have much evidence linking them to migraines. Despite their inclusion in several studies, results were inconclusive for tyramine (a substance found in aged cheeses and fermented foods), artificial sweeteners, and—hooray!—chocolate. That doesn’t mean that some people aren’t sensitive to these foods—just that a significant link hasn’t yet been established.

If you’re not sure what, exactly, is causing your migraines, Dr. Martin recommends keeping a diary of meals and symptoms, and working with a doctor on an elimination diet that can hopefully pinpoint the culprit (or culprits).

Or, you could try the second approach to managing migraines with diet: following a very specific meal plan, rather than paying attention to individual foods. One of the most promising diets, according to the research, is one that boosts intake of omega-3 fatty acids but reduces levels of omega-6s.

Omega-6s are found in vegetable oils, such as corn, sunflower, safflower, canola, and soy oil. Research shows that these fats are healthy in small amounts, but that the American diet includes way too many of them—and that we should be consuming more heart- and brain-healthy omega-3s, instead.

To get more omega-3s, says Dr. Martin, include foods like flaxseed, salmon, halibut, cod, and scallops in your diet on a regular basis. He also recommends avoiding peanuts and cashews, which are high in omega-6s.

The review, published in the journal Headache, also looked at low-fat, low-cholesterol, gluten-free, and high-folate diets as potential treatments for migraines.

Two studies examined the effects of low-fat diets—which require you to get less than 20 percent of your daily calorie requirements from fat—and both showed promise. "The beauty of these diets is that they not only reduce headaches, but may produce weight loss and prevent heart disease," said co-author Vij Brinder, M.D., associate director of the Headache and Facial Pain Center.

Diets that are extremely low in carbohydrates, such as the ketogenic diet, can also reduce headache frequency, the review found. But because they’re so restrictive (the ketogenic diet allows no more than 20 grams of carbs a day) and have been linked to kidney problems, they shouldn’t be considered without your doctor’s supervision, say the authors.

Gluten-free diets, on the other hand, only seemed to be helpful if a person’s headaches were a symptom of celiac disease; people who don’t test positive for the disease via a blood test or intestinal biopsy likely won’t get the same relief, the authors say. As for high-folate diets, they seem to work best for people who get migraines with aura, the research concludes.

Overall, Dr. Martin says that people with migraines have more dietary options than ever before—and that eating for headache prevention is a lot like eating for overall health.

“Ultimately a healthy headache diet excludes processed foods, minimizes caffeine and includes a lot of fruits, vegetables, fish and lean meats,” he says. “After all, you are what you eat.”

 
This article originally appeared on RealSimple.com.