You can get gonorrhea by having vaginal, anal, or oral sex with someone who has gonorrhea. A pregnant woman with gonorrhea can give the infection to her baby during childbirth.