There are a myriad of reasons why vaginal flora can get out of whack. Some are easy to explain. Antibiotics can kill off the good bacteria along with the bad, giving yeast a chance to proliferate, and overcleaning the vagina can upset the normal balance of healthy bacteria, leading to infections. But sometimes the problem is harder to pinpoint. Is it because your partner forgot to wash their hands before sex? What’s really behind all that itching and discharge?

Thankfully, it’s usually not because of someone’s unwashed hands. “Certainly, everyone should practice good hygiene and hand-washing,” says Dr. Christina Lewicky Gaupp, a urogynecology and pelvic reconstructive surgeon at Northwestern Memorial Hospital in Chicago. But Dr. Lewicky Gaupp points out that the vagina is self-cleaning, so you don’t have to be sterile when you have sex.

Unlike STIs, vaginal infections like yeast overgrowth or bacterial vaginosis are caused by a pH imbalance. The vagina keeps unwelcome microorganisms from taking over when it maintains an acidic pH of 3.8 to 4.5. But when something foreign is introduced, it can make the vagina more alkaline and hospitable to bacteria. Dr. Lewicky Gaupp said the culprit can be semen and bodily fluids — especially from a new partner — along with medication and even lubricant. (If you’re sensitive to certain lubricants, opt for something organic and water-based. Types made from silicone or oil can stick around and upset the vagina.)  

Vaginal infections can pop up after sex because certain problems are more likely when another person’s body chemistry is involved. If you’re concerned about keeping your vagina healthy, here are some situations that are more likely to lead to an infection and steps you can take to try to prevent them.

Yeast infections
A weak immune system, diabetes, or hormonal changes during pregnancy can make someone more prone to yeast infections. While hormonal birth control doesn’t cause a yeast infection, it can raise your risk of developing one because it offsets the usual balance of estrogen and progesterone in the body. Even sitting around in your wet workout clothes or bathing suit can cause problems. Certain medications like antibiotics, steroids, or chemotherapy can also make an infection more likely.

If you always experience yeast overgrowth when you take antibiotics, talk to you doctor about taking an oral anti-fungal before your next treatment.

Bacterial vaginosis
Bacterial vaginosis (BV) is the most common vaginal infection in women ages 15-44 and can increase the chances of contracting an STI. While the exact cause of BV isn’t understood, research shows sexual activity itself, especially with new or multiple partners, can trigger an infection. So can douching and using vaginal deodorants.

Using a condom, dental dam, or limiting your number of sexual partners might help with prevention, though it’s not a guarantee. And pensises and semen aren’t the only thing that can contribute to BV. Same-sex female partners actually show a higher risk for contracting the bacterial infection. Studies show an increased risk in females whose female partners already have BV, indicating the possibility that vaginal fluids may spread the bacteria.

Urinary tract infection
The female urethra is short and right next to the vagina, so sex can easily introduce bacteria into the bladder. While peeing after sex is recommended, it’s not a surefire way to prevent a UTI. Research shows the microbiota of the bladder and vagina of people prone to urinary tract infections is different than those who hardly ever or never get one.

“Women who have recurrent UTIs — and other urinary tract symptoms like urgency, frequency or other things that masquerade as a UTI — don’t have as much Lactobacillus,” says Dr. Lewicky Gaupp.

While antibiotics are the best way to treat a UTI, acidifying the urine with vitamin C can make it more difficult for the bacteria to multiply and cause an infection, says. Dr. Lewicky Gaupp. A low-dose antibiotic can also be taken directly after sex to help prevent bacteria from colonizing.

But if you think you have a UTI, make sure to get a urine culture from your doctor. Some UTI-like symptoms aren’t caused by an infection.

When can you have sex after an infection
Getting a UTI, yeast infection, or bacterial vaginosis is a drag, but there are oral and vaginal medications that can help. And while you probably shouldn’t have sex during your treatment if it involves a vaginal cream, you can resume sexual activity once you no longer have uncomfortable symptoms — including discharge, burning, itching, or pain with sex or urination.

“We don’t tell patients not to have sex while they’re on medication,” says Dr. Lewicky Gaupp. “Once they’re not symptomatic and feel good, they can have sex if they want to.”

Keri Wiginton is a writer and photographer focusing on issues related to women's health, mental well-being, and feminism. Her work has appeared in the Chicago Tribune, Washington Post, Austin-American Statesman, Tampa Bay Times and Houston Chronicle. Follow her work at www.keriwiginton.com or on Twitter at @keriphoto.