Key takeaways:
You can avoid a urinary tract infection (UTI) by making simple changes — like drinking more water, wiping from front to back, and peeing right after sex.
People who get frequent UTIs can take antibiotics after sex to prevent a UTI.
Dietary supplements, like cranberry products or probiotics, may help prevent UTIs.
Urinary tract infections (UTIs) are a common problem. A UTI happens when bacteria invade your urinary tract. This can happen when bacteria travel through your urethra (the tube that carries urine from the bladder out of your body).
There’s a lot of advice out there about how to prevent UTIs. If you get UTIs often, you may have already tried some (or all) of these tips and found that they didn’t help. So, what actually works to prevent UTIs — and what doesn’t? Here are five science-backed ways to avoid UTIs.
Estrogen helps prevent UTIs by making your vagina more acidic. This helps good bacteria thrive and makes it harder for the bacteria that causes UTIs to survive. Shifting the balance towards good bacteria can help prevent UTIs.
As you get older, your body makes less estrogen. This can lead to more UTIs. Studies show that if you’re perimenopausal or postmenopausal and get recurrent UTIs, vaginal estrogen can lower your risk of developing UTIs.
Vaginal estrogen comes in different forms: as a ring (Estring), an insert (Vagifem), or a cream (Premarin, Estrace). Your healthcare team can help you choose the right product and give you a prescription.
People usually take antibiotics if they already have an infection. But taking antibiotics every day or after sex can help prevent a UTI before it starts. Prophylactic antibiotics are a good option for people who get frequent UTIs, including people who get UTIs after sex.
Your chance of getting a UTI can increase after having sex. That’s because during sex, bacteria from the skin can move closer to the urethra and cause a UTI. If you often get UTIs after sex, taking a single dose of an antibiotic within 2 hours after sex can help prevent them.
Another option is to take a low-dose antibiotic every day for up to 6 to 12 months. This can also stop frequent UTIs.
Antibiotics used for UTI prophylaxis include:
Nitrofurantoin (Macrobid)
Trimethoprim-sulfamethoxazole (Bactrim)
Cephalexin (Keflex)
Cefaclor (Ceclor)
Fosfomycin (Monurol)
Get the right treatment. Our experts review the best antibiotics for urinary tract infections (UTIs).
Compare over-the-counter (OTC) options: OTC medications can’t cure a UTI. But they can help ease your symptoms. Learn what the science says about OTC options for treating UTI pain and discomfort.
Prevent future UTIs. Get tips from our medical team to help lower your chances of developing a UTI. Plus, see a list of conditions that may contribute to recurrent UTIs.
But there are drawbacks to this method. UTIs can come back when you stop taking antibiotics. Also, using antibiotics too often can lead to antibiotic resistance, which may make it harder to treat future infections.
Staying hydrated during the day may help prevent UTIs. The theory is that drinking plenty of water helps “flush out” your bladder. This pushes bacteria out quickly, before they have time to multiply and cause infection.
But there haven’t been a lot of studies to prove this works. One study in premenopausal women with frequent UTIs found that those who drank at least 50 oz of water a day had fewer UTIs.
During sex, bacteria that live on your skin and around your genitals can get moved toward your urethra. Peeing soon after sex may help flush out these bacteria so they don’t cause an infection.
This is a longstanding theory, but there isn’t a lot of evidence to back it up. Even so, many experts still recommend peeing after sex because it has no downsides and it does work for some people.
Bacteria that live in your gut — like Escherichia coli (E. coli) — live on your stool too. And E. Coli is the bacteria that causes most UTIs. Wiping from front to back keeps E. coli from getting too close to your urethra and causing UTIs.
While this theory makes sense, it hasn’t been well studied. But there are studies showing that people who wipe back to front might have a higher risk of developing UTIs.
Like peeing after sex, wiping from front to back is a simple, low-risk habit that can decrease your risk of getting a UTI.
If prophylactic antibiotics or vaginal estrogen aren’t your thing (or you can’t use them), there are still other things you can add to your prevention arsenal.
These options don’t have quite as much evidence behind them, but here are four more things you can try to help prevent UTIs.
Cranberries contain compounds called proanthocyanidins. These make it harder for bacteria to stick to your urinary tract and cause infection. But it’s not clear if cranberry products work for everyone.
It’s also not clear which cranberry product works best or how much you need to take to prevent UTIs. Some studies show that you may need to drink between 5 oz and 25 oz of cranberry juice (not cranberry cocktail) every day to see an effect.
Cranberry juice contains a lot of sugar, so it might not be right for you. But there may be other cranberry products you can try. Some small studies show that eating dried cranberries and taking cranberry tablets might work.
Probiotics are dietary supplements that contain live bacteria. One type, called Lactobacillus, is a “good bacteria” that lives in your gut and vagina. People who don’t have as much Lactobacillus in their vagina tend to get more UTIs.
So, by reestablishing your Lactobacillus, you may be able to decrease your risk of developing UTIs. But studies show it doesn’t work for everyone.
Lactobacillus comes in a capsule that you take by mouth or as an intravaginal suppository. The FDA doesn’t regulate probiotics, so this makes it tricky to know which brand or type will work best.
Methenamine hippurate is a prescription medication that makes it harder for bacteria to grow inside your urethra and bladder.
Some studies show it can help prevent UTIs. Methenamine is generally safe and doesn’t put you at risk for developing resistance to antibiotics. It may be worth trying if you get frequent UTIs and want to avoid taking daily antibiotics.
Spermicide can increase your risk of developing a UTI. Some birth control options, like diaphragms, need spermicide to work.
Switching to a birth control that doesn’t use spermicide can help lower your risk of getting UTIs.
You should seek care as soon as possible if you have symptoms of a UTI, like:
Pain or burning when you pee
An urgent need to pee
Needing to pee frequently
Cloudy, pink, or blood-tinged urine
Pain in your lower abdomen, where your bladder sits
Your healthcare team can diagnose a UTI and start you on antibiotic treatment right away. This will help you feel better faster and prevent complications from UTIs, like kidney infections.
UTIs usually don’t go away on their own without antibiotic treatment. And taking a “wait-and-see” approach can increase your chances of a kidney infection — especially if you’re pregnant or have a weakened immune system. So, it’s best not to wait to seek care.
The good news is that your prescriber may be able to provide you with a prescription for antibiotics through a telehealth appointment, especially if you have a history of UTIs and aren’t at risk for UTI complications.
Staying hydrated and emptying your bladder regularly can help prevent UTIs in older adults. Encourage older adults to drink enough fluids throughout the day. Older adults may have trouble getting to the bathroom because of mobility issues. Having a bedside commode or an easy-to-reach toilet can help, especially during the day and night.
UTIs aren’t contagious. You can’t catch a UTI or kidney infection from another person.
Some yogurts have live bacteria cultures, also known as probiotics. Probiotics may help some people avoid getting UTIs in the future. But they won’t help if you already have a UTI. It’s also not clear how much yogurt you need to eat to get the benefits of probiotics. Most people choose probiotic supplements instead.
Some people can take one dose of antibiotics every day to prevent UTIs. This method isn’t right for everyone. Your healthcare team can help you decide if this approach is right for you.
If you get frequent UTIs, there are things that can help lower your risk of developing them. Simple changes — like drinking more water, peeing after sex, and wiping from front to back — may help prevent UTIs. Taking a single dose of antibiotics after sex (or once a day) can also prevent UTIs.
Albert, X., et al. (2004). Antibiotics for preventing recurrent urinary tract infection in non-pregnant women. Cochrane Database of Systematic Reviews.
Burleigh, A. E., et al. (2013). Consumption of sweetened, dried cranberries may reduce urinary tract infection incidence in susceptible women--A modified observational study. Nutritional Journal.
Centers for Disease Control and Prevention. (2024). Urinary tract infection basics.
Dason, S., et al. (2011). Guidelines for the diagnosis and management of recurrent urinary tract infection in women. Canadian Urological Association Journal.
Fihn, S. D., et al. (1996). Association between use of spermicide-coated condoms and Escherichia coli urinary tract infection in young women. American Journal of Epidemiology.
Hooton, T. M., et al. (2018). Effect of increased daily water intake in premenopausal women with recurrent urinary tract infections a randomized clinical trial. JAMA International Medicine.
Kirjavainen, P. V., et al. (2009). Abnormal immunological profile and vaginal microbiota in women prone to urinary tract infection. Clinical and Vaccine Immunology.
Kodner, C. M., et al. (2010). Recurrent urinary tract infections in women: Diagnosis and management. American Family Physician.
Krouse, M., et al. (2009). Local effects of vaginally administered estrogen therapy: A review. Journal of Pelvic Medicine & Surgery.
Lee, B. S. B., et al. (2012). Methenamine hippurate for preventing urinary tract infections. Cochrane Library of Systematic Reviews.
Loubet, P., et al. (2020). Alternative therapeutic options to antibiotics for the treatment of urinary tract infections. Frontiers in Microbiology.
Persad, S., et al. (2006). Association with urinary tract infection and post micturition wiping habit. Acta Obstetricia et Gynecologica.
Raz, R., et al. (1993). A controlled trial of intravaginal estriol in postmenopausal women with recurrent urinary tract infections. The New England Journal of Medicine.
Stapleton, A. E., et al. (2016). The vaginal microbiota and urinary tract infection. Microbiology Spectrum.