After unprotected sex, you have a limited but real window to lower your risk of several sexually transmitted infections and unintended pregnancy. The most time-sensitive step is getting to a clinic or emergency room within 72 hours, because that’s the cutoff for the most effective medical interventions. Here’s what to do, in order of urgency.
Start HIV Prevention Within 72 Hours
Post-exposure prophylaxis, known as PEP, is a 28-day course of HIV medication that can prevent the virus from establishing itself in your body. It must be started within 72 hours (3 days) of exposure, and the sooner you begin, the better it works. You can get PEP from an emergency room, an urgent care clinic, or a sexual health clinic.
PEP isn’t prescribed after every encounter. A healthcare provider will assess your specific situation, including the type of sex, whether your partner’s HIV status is known, and other risk factors. If PEP is appropriate, you’ll take the medication every day for the full 28 days. Missing doses or stopping early reduces its effectiveness significantly.
Ask About Antibiotic Prevention for Bacterial STIs
A newer option called doxy-PEP uses a single dose of the antibiotic doxycycline (200 mg), taken within 72 hours after sex, to reduce the risk of three common bacterial infections. In large clinical trials, it cut chlamydia and syphilis infections by more than 70% and gonorrhea infections by roughly 50%.
The CDC released formal guidelines for doxy-PEP in 2024, recommending that providers offer it to men who have sex with men and transgender women who have had a bacterial STI in the past year or who are on HIV PrEP. If you fall into one of these groups, ask your provider whether a prescription makes sense for you. The maximum dose is 200 mg in any 24-hour period.
Consider Emergency Contraception
If pregnancy is a concern, emergency contraception is most effective the sooner you use it, though all options work within five days of unprotected sex.
- Levonorgestrel pills (Plan B and generics): Available over the counter at most pharmacies without a prescription or age restriction. Pregnancy rates in studies ranged from 1.2% to 2.1%. These pills are less effective for people with a BMI over 30, though they’re still considered safe to take.
- Ulipristal acetate (ella): Requires a prescription but maintains its effectiveness better across the full five-day window, with a pregnancy rate of about 1.2% in clinical trials.
- Copper IUD: The most effective emergency contraceptive available, preventing pregnancy more than 99% of the time when inserted within five days. It requires a clinic visit but also provides ongoing contraception for years afterward.
Hepatitis B Protection
If you’ve never been vaccinated against hepatitis B, post-exposure treatment is available and works best within 24 hours. An unvaccinated person should receive both an immune globulin injection and the first dose of the hepatitis B vaccine series as soon as possible. If you’ve been partially vaccinated, the remaining doses should be completed on schedule. Most people vaccinated as children are already protected, but if you’re unsure of your status, a quick blood test can check.
Get Tested at the Right Time
Testing too early after exposure will miss an infection that hasn’t had time to become detectable. Each STI has its own window period, so one visit right away won’t cover everything. Here’s when tests become reliable:
- Chlamydia and gonorrhea: A test at one week catches most infections. Testing at two weeks catches nearly all of them. Both use a urine sample or a swab.
- Syphilis: A blood test at one month detects most cases. Testing at three months catches almost all.
- HIV (blood test): A lab-based blood test that checks for both antigen and antibody picks up most infections at two weeks, with nearly complete accuracy by six weeks. An oral swab or rapid antibody-only test takes longer to become reliable, catching most cases at one month and almost all by three months.
A practical approach is to get an initial screening at about two weeks for chlamydia and gonorrhea, then return around three months for syphilis and a confirmatory HIV test. If you develop symptoms before those timelines, go in sooner.
Why Lab-Based Tests Are More Reliable
If you’re choosing between a rapid point-of-care test and a lab-processed test, the lab version is significantly more accurate for most bacterial STIs. Rapid antigen tests for chlamydia, for example, have a sensitivity of only about 54%, meaning they miss nearly half of actual infections. Lab-based tests that amplify genetic material from the bacteria are the gold standard and are what clinics use for definitive results. Rapid HIV tests are useful for screening but should be confirmed with a lab-based test if your exposure was recent.
What Symptoms to Watch For
Many STIs produce no symptoms at all, which is why testing matters regardless of how you feel. When symptoms do appear, they typically show up on different timelines. Chlamydia and gonorrhea symptoms, such as unusual discharge, burning during urination, or rectal discomfort, can appear within a few days to two weeks. Syphilis usually starts as a painless sore at the site of contact, often appearing two to three weeks after exposure but sometimes taking longer. Early HIV infection can cause flu-like symptoms (fever, sore throat, body aches, swollen glands) roughly two to four weeks after exposure, though many people experience nothing noticeable.
The absence of symptoms does not mean you’re in the clear. Chlamydia in particular is silent in the majority of cases, and untreated infections can cause long-term reproductive damage.
Where to Get Help
If cost or privacy is a concern, the CDC maintains a searchable database at gettested.cdc.gov where you can find free or low-cost testing sites near you by zip code. These clinics offer confidential services and often don’t require insurance. Many Planned Parenthood locations, local health departments, and community health centers also provide sliding-scale STI testing and treatment. For PEP specifically, emergency rooms can prescribe it on the spot if your exposure happened within the past 72 hours.