Constipation doesn't directly cause headaches, but it can lead to bloating and pain, creating a general feeling of discomfort that may contribute to headaches. Tension and stress caused by constipation can worsen or trigger new headaches. Dehydration, often linked to constipation, can also be a common cause of headaches.