Are STDs only spread when you have sex?

Usually. Most STDs are spread by oral, vaginal, or anal sex. Because most STDs are also blood-borne, however, they can also be spread via blood contact with an open wound.