A holistic concept based on traditional Persian medicine (TPM) describes a headache with a gastrointestinal (GI) origin (gastric-headache). Although the neurological manifestations of this headache are similar to those of other headaches, its etiology is different. Considering its simultaneous effects on the brain and GI system, a formulation was designed based on this concept. This study aimed to determine the safety and efficacy of the designed formulation on migraine headache (MH) associated with functional dyspepsia (FD). A total of 75 diagnosed cases of MH patients with concurrent FD were randomly divided equally into 3 groups: (i) the polyherbal formulation, sodium valproate (VPA), and amitriptyline group, (ii) VPA, amitriptyline, and polyherbal formulation placebo group, and (iii) the polyherbal formulation and VPA placebo group. The primary outcomes, including frequency, duration, and severity of MH attacks, were measured at baseline and weeks 4, 8, and 12. However, secondary outcomes, including the Headache Impact Test 6 (HIT-6) Questionnaire and Parkman’s score, were evaluated at baseline and end of treatment. The frequency, duration, and severity of migraine (
P
<
0.001
for all cases), HIT-6 (
P
<
0.001
for all cases), and FD (
P
<
0.001
for all cases) scores at the end of treatment showed a significant decrease in the 3 groups compared to the baseline. However, the differences in those variables between the 3 groups were not significant at the end of the study. The polyherbal formulation alone may improve the symptoms of migraine patients and other groups. This effect could be due to improving digestion and FD in migraine patients.