Yes, drinking caffeine can cause headaches. According to a study by UCLA medical professionals, a headache can be caused by blood vessels in the brain dilating or swelling. Caffeine is a mild stimulant that narrows blood vessels around the brain while giving you a burst of energy. In this case, consuming caffeine can cause a headache. On the other hand, if your body develops a dependence on caffeine and then experiences withdrawal, you can also experience a headache. Withdrawal can trigger the blood vessels in your brain to dilate, causing a headache. In this sense, while the caffeine may not be directly causing a headache, the habit of drinking caffeine is. While it is unclear whether the claim is referencing the single time or habitual use of caffeine, it does not matter as both appear true in eventually having the ability to cause a headache.
The discourse surrounding caffeines ability to cause headaches from UCLA proves to hold true as similar sources from other medical professionals support their thinking. Professionals from The Medical University of Warsaw, in the National Library of Medicine, also state that caffeine can both relieve and trigger headaches. The findings in this study conclude that caffeine has the ability to trigger a migraine attack, caffeine withdrawal can provoke headache, and caffeine can cause chronic headaches. While it is not proven that drinking caffeine always causes headaches, it appears that caffeine does have the ability to cause a headache. So yes, the claim “caffeine can cause headaches” is true.
Sources:
https://www.uclahealth.org/news/article/caffeine-connection-between-coffee-and-headaches
https://pmc.ncbi.nlm.nih.gov/articles/PMC10385675/