Both gonorrhea and chlamydia are caused by bacteria. The bacteria are passed from one person to another through vaginal, anal, or oral sex. Gonorrhea and chlamydia often occur together.