“Four days per month really outperforms anything we’ve seen from a pharmacological preventive,” said Dr. Burch, a headache medicine specialist at Brigham and Women’s Hospital and an assistant professor of neurology at Harvard Medical School.

Dr. Burch said that people who struggle with migraine headaches are often motivated to follow restrictive diets to try to find some relief for their condition. But until now there has not been much evidence that any particular diet works. “This is the first time that we’ve had a robust, solid diet that we can recommend to patients,” she added.

For people who want to try the diet on their own, the researchers said that the simplest way to increase omega-3 intake is to eat more fatty fish, such as sardines, anchovies, mackerel, salmon, albacore tuna and trout. Some of the best and most affordable options are canned and pouched fish. For vegetarians, good plant sources of omega-3 fats are ground flaxseeds, chia seeds and walnuts.

Another important component of the diet is avoiding fried, processed and fast foods, which are typically made with oils that are low in omega-3s and high in omega-6s. Beth MacIntosh, a co-author of the new study, said that extra virgin olive oil, avocado oil, macadamia oil, coconut oil and butter tend to contain low amounts of omega-6 fats.

You can use these oils to cook meals or to make your own snack foods, like popcorn, hummus and granola. The researchers also encouraged people in the study to eat at least five servings of fruits and vegetables per day.

“Fruits and vegetables are naturally low in omega-6 fatty acids — and they’re just healthy,” said Ms. MacIntosh, the clinical nutrition manager of the Metabolic & Nutrition Research Core at UNC Health in Chapel Hill.