Opioid pain medication can help relieve your pain but may have an undesired effect in the gut that causes constipation. This constipation, called opioid-induced constipation, happens when opioids attach to mu-opioid receptors in your bowel. This is the underlying cause of opioid-induced constipation and can make it difficult for you to have bowel movements. opioid-induced constipation can last the entire time you're taking opioid pain medication.