How to Prevent STDs: Condoms, Vaccines, and More

Preventing STIs comes down to a layered approach: barrier methods like condoms, vaccines, regular testing, and in some cases, preventive medications. No single strategy eliminates all risk, but combining several of them dramatically lowers your chances of getting or spreading an infection. Here’s what actually works and how well each method performs.

Condoms: The First Line of Defense

External (male) condoms remain the most accessible and well-studied barrier method. When used consistently and correctly, they reduce HIV transmission by about 85%, provide over 90% protection against gonorrhea, and offer 50 to 90% protection against chlamydia. The variation in those numbers reflects real-world use. People skip condoms occasionally, put them on partway through sex, or use them incorrectly, and all of that lowers the effective protection rate.

Internal (female) condoms work on the same principle, covering vaginal or anal surfaces to block fluid exchange. They’re a good alternative when an external condom isn’t an option, though they have less research behind them.

Condoms work best against infections spread through bodily fluids: HIV, gonorrhea, chlamydia, and trichomoniasis. They’re less reliable against infections spread through skin-to-skin contact, including herpes, syphilis, and HPV. These can live on skin that a condom doesn’t cover, like the base of the penis, the scrotum, or the inner thighs. A condom still helps if the sore or infected area happens to be in a covered zone, but it can’t guarantee protection when it isn’t.

Oral Sex Isn’t Risk-Free

Gonorrhea, chlamydia, syphilis, HPV, and herpes can all be transmitted through oral sex. Dental dams (thin sheets of latex placed over the vulva or anus) and condoms used during oral sex on a penis create a physical barrier, but the honest truth is that very few people use them. Research on dental dams specifically is limited, and no study has been able to show a statistically significant reduction in STI transmission from their use alone. That said, the logic behind them is sound: if condoms reduce transmission by blocking contact with fluids and skin, a dental dam should do the same. The data gap is mostly a usage gap.

If you have oral or anal sex, talk with your provider about throat and rectal testing. Standard urine or genital tests won’t catch infections at those sites.

Vaccines That Prevent STIs

Two vaccines directly prevent sexually transmitted infections, and a third shows promising crossover protection.

HPV Vaccine

The HPV vaccine is close to 100% effective at preventing infection from the virus strains it targets, which together account for about 81% of cervical cancers in the U.S. and the vast majority of genital warts. The CDC recommends vaccination at age 11 or 12 (it can start as early as 9), and catch-up vaccination through age 26 for anyone who wasn’t fully vaccinated earlier. If you’re in that age range and haven’t been vaccinated, this is one of the highest-impact prevention steps you can take.

Hepatitis B Vaccine

Hepatitis B spreads through sexual contact and blood. The adult vaccine series involves either two or three doses depending on the formulation. Studies show immunity lasts at least 30 years when vaccination starts in childhood, and most adults maintain strong protection for decades as well. If you weren’t vaccinated as a child, the series is worth completing.

Meningococcal B Vaccine and Gonorrhea

A vaccine originally designed to prevent meningitis (the MenB-4C vaccine) appears to offer roughly 32% protection against gonorrhea, according to a meta-analysis published in The Journal of Infectious Diseases. The two bacteria are closely related, sharing 80 to 90% of their outer membrane proteins. Protection is modest and may fade after about three years, but given the rising antibiotic resistance in gonorrhea, even partial protection has public health value. This isn’t currently recommended specifically for gonorrhea prevention, but it’s an active area of interest.

PrEP for HIV Prevention

Pre-exposure prophylaxis, or PrEP, is a medication taken before potential exposure to HIV. When taken as prescribed, PrEP reduces the risk of getting HIV from sex by about 99%. For people who inject drugs, the risk reduction is at least 74%. PrEP is available as a daily pill or as an injection given every two months. It does not protect against any other STIs, so it works best as part of a broader prevention plan that includes condoms and regular testing.

Doxy-PEP for Bacterial STIs

A newer strategy called doxy-PEP involves taking a single 200 mg dose of the antibiotic doxycycline within 72 hours after sex. Across three large clinical trials, this approach reduced syphilis and chlamydia infections by more than 70% and gonorrhea infections by about 50%. The CDC released formal guidelines for doxy-PEP in 2024. Current recommendations focus on men who have sex with men and transgender women, the populations in which the trials were conducted. You should not exceed one dose per 24-hour period.

Doxy-PEP is a prescription, so you’d need to discuss it with a healthcare provider. It’s not a replacement for condoms or testing. There are also legitimate concerns about antibiotic resistance with widespread use, which is why the recommendations are currently limited to higher-risk groups.

Regular Testing Catches What Prevention Misses

Many STIs cause no symptoms for weeks, months, or ever. Chlamydia and gonorrhea are frequently silent, and syphilis can go unnoticed in its early stages. Regular screening catches infections before you unknowingly pass them to someone else and before they cause long-term damage like infertility or organ involvement.

Current CDC screening recommendations break down by group:

  • Everyone ages 13 to 64: at least one HIV test in your lifetime
  • Sexually active women under 25: gonorrhea and chlamydia testing every year
  • Women 25 and older with new or multiple partners: annual gonorrhea and chlamydia testing
  • Men who have sex with men: syphilis, chlamydia, and gonorrhea at least once a year (every 3 to 6 months with multiple or anonymous partners), plus HIV at least annually
  • Pregnant women: syphilis, HIV, hepatitis B, and hepatitis C early in pregnancy
  • Most sexually active adults: syphilis testing based on local prevalence

Testing Window Periods

If you think you were recently exposed, getting tested the next day won’t give you reliable results. Each infection has a window period during which the test can’t yet detect it. For HIV, that window is about 3 to 4 weeks. For syphilis, it’s 2 to 6 weeks. If you’re tested during this window and get a negative result, consider retesting after the window has passed to confirm. Gonorrhea and chlamydia tests using a nucleic acid method can detect infection sooner, but providers often recommend retesting at 4 to 6 weeks after exposure to rule out co-infections like HIV and syphilis.

Reducing Partners and Mutual Testing

The math is straightforward: fewer sexual partners means fewer opportunities for exposure. This doesn’t mean abstinence is the only safe option, but being selective and having open conversations about testing history with partners meaningfully lowers your risk. Getting tested together before a new sexual relationship starts is one of the most practical things two people can do. Combined with consistent condom use and vaccination, it puts you in a strong position against nearly every common STI.