When coughing triggers head pain, it is usually because the pressure inside the head rises suddenly for a brief moment. For many people, this causes a short, sharp headache that starts right when they cough and fades quickly. This is often called a primary cough headache and is not linked to another disease.
Coughing acts like straining, which can briefly change how blood and fluid move inside the skull. In some people, this pressure change is felt as pain, often on both sides of the head and lasting seconds to a minute. The pain tends to be stronger with intense or repeated coughing.
In a smaller number of cases, a cough headache can be a sign of an underlying problem that affects how the brain sits or how fluid drains from the head. These headaches may last longer, feel more severe, or come with other symptoms. Because of this, ongoing or unusual cough headaches should not be ignored.
Do not try to treat this on your own with strong pain medicines. If the pain is frequent, worsening, or different from usual headaches, evaluation by a neurologist is important to rule out more serious causes and guide safe treatment.