The headaches come from caffeine withdrawal, which can affect anyone deviating from their usual caffeine intake.
Caffeine researcher Ted Kallmyer recommends the weaning method, aka gradually cutting back. “Many think this means drinking one less cup of coffee per day,” he says, “but actually, that increment is too large.” Try a much smaller step back: If your normal daily consumption is one 16-oz cup, a reasonable step down would be to switch to the 12-oz size. After a few days of this amount, you can then step down to an 8-oz cup of coffee, and so on. If you make it yourself, cut your usual amount by no more than a quarter cup: So a two-cup-a-day drinker would start with 1 3/4 cups, then step down 1/4 cup every two to three days.
“The withdrawal symptoms are much less severe this way,” Kallmyer says.