Any drug that is classified as an "opioid" can cause constipation. Examples of commonly prescribed opioids that may cause this side effect include morphine, tramadol, fentanyl, methadone, hydrocodone, codeine and oxycodone.