11 Ways That You Can Get a UTI

Plus, how to prevent the common infection.

If you've had a urinary tract infection (UTI), you know how uncomfortable it can make you feel. Burning, the urge to urinate, and pelvic pain can all be part of having UTIs, and UTIs can happen easily.

"In the simplest terms, a UTI can occur when bacteria enter the urethra—the tube you urinate through—and travel to the bladder or kidneys," said S. Adam Ramin, MD, a urologic surgeon and medical director of Urology Cancer Specialists in Los Angeles.

Urethras are shorter in people assigned female at birth than those assigned male at birth. Female urethras measure 3-4 cm, while male urethras measure 18-20 cm. As a result, it takes longer for bacteria to get to the bladder or kidneys and cause an infection for people assigned male at birth.

Also, the urethra is closer to the rectum for people assigned female at birth. This increases the odds that bacteria will get into the urinary tract and cause an infection, said Dr. Ramin. "Every human on the planet has a significant number of bacteria on the skin surrounding the rectum and genitals," added Dr. Ramin.

Therefore, to minimize your risk of getting a UTI, it's helpful to know what can cause a UTI to happen.

What Are the Causes of a UTI?

There are 11 common causes of UTIs, ranging from lifestyle factors to health conditions.

Sex

Having sex causes bodily fluids to mingle—yours and your partner's. That means particles from your anus can travel forward, where they can potentially get pushed up your urethra.

"The act of intercourse literally pushes this bacteria from the vaginal vault into the urethra," and is the "most significant risk factor" for UTIs in women who are sexually active, said David Kaufman, MD, director of New York City's Central Park Urology, a division of Maiden Lane Medical.

The best things you can do to prevent this, Dr. Ramin said, are keeping the area clean with mild soap and water and peeing after sex.

Kidney Stones

Kidney stones, or hard deposits that can form in your urinary tract, are "some of the most common risk factors" for UTIs, said Lauren Cadish, MD, a urogynecologist at Providence Saint John's Health Center in Santa Monica, California.

Additionally, kidney stones "act as a safe haven for bacteria to survive antibiotic treatment," said Dr. Kaufman. They can also block your urinary tract—making it hard to get all of your urine out—which can let bacteria thrive.

While the formation of stones can be genetic, doing things like staying well hydrated, avoiding too much sodium, and limiting how much animal protein you eat may help you avoid getting them.

Wiping the Wrong Way

A 2021 study found that 61.9% of 719 women reported wiping from front to back as a preventative measure against getting a UTI. Thus, wiping appropriately after using the restroom may lower your chances of experiencing a UTI.

Regularly wiping from back to front is "a really bad move," said Dr. Kaufman, explaining that "this would essentially push bacteria from the anal/rectal area into the vagina." If you've always wiped from back to front, it can take some time to remember to do it the other way, but Dr. Kaufman said it can make a big difference in your UTI risk.

Gastrointestinal Issues

Struggling with diarrhea increases the risk of UTI-causing bacteria making their way into your bladder, said Dr. Kaufman. Additionally, being constipated can make it tough to completely empty your bladder. With urine remaining, the risk that bacteria will multiply is increased. Even passing gas "aerosolizes bacteria," which can spread to your upper genitalia, said Dr. Kaufman.

While you can only do so much about random constipation, diarrhea, and flatulence, if you're chronically struggling with any of these, it's worth talking with a healthcare provider about what might be going on. Dr. Kaufman also stressed the importance of wiping from front to back after having a bowel movement.

Pubic Hair

Pubic hair can act as a "ladder" for bacteria to go from the anus to the vagina, said Dr. Kaufman. It can also trap bacteria from your partner during sex, where it can wind up in your urethra. If UTIs are a problem, you can either clean regularly with mild soap and water or keep pubic hair trimmed.

Holding in Your Urine

Sometimes you may not be able to make it to the bathroom the second the urge strikes, but regularly holding in your urine can increase your risk of a UTI. "You should never hold your urine for too long or rush through urination," said Dr. Ramin.

Also, it's important to empty your bladder each time you go, which "can increase the chances of expelling UTI-causing germs from your body, thereby further reducing your risk of developing an infection," said Dr. Ramin. One recommendation is to go no longer than three hours between bathroom breaks.

Uncontrolled Diabetes

Having uncontrolled diabetes can increase your risk of a UTI in several ways, said Dr. Kaufman. One reason is that blood flow to the bladder nerves can be diminished, making it harder to contract the bladder properly and fully empty it.

"If you can't expel urine, any bacteria will continue to multiply," said Dr. Kaufman. Chronic diseases such as diabetes suppress your immune system and can disturb your body's ability to respond to bacteria. And uncontrolled diabetes, specifically, causes your body to spill glucose (sugar) into your pee, creating a perfect environment for bacteria to thrive.

If you have diabetes, keeping your blood sugar within your target range is really the best way to prevent urinary tract infections tied to the condition, said Dr. Kaufman.

Certain Types of Birth Control

While they're less commonly used forms of birth control, diaphragms can increase your risk of a UTI. "Diaphragms compress the urethra and can potentially interfere with complete emptying of the bladder post-sex," said Dr. Kaufman, adding that they are "not a good birth control option for women who get recurrent post-coital infections."

Spermicides can also increase the probability of a person getting a UTI. They are another type of birth control that works by killing sperm. Prior to sex, spermicides are placed in the vagina in a particular form (e.g., foam, film, tablet) up to an hour beforehand.

If you tend to be prone to UTIs and use diaphragms or spermicides regularly, you'll want to talk with a healthcare provider about other birth control options, like oral contraception, injections, or implants.

Tight-Fitting Clothing

Tight pants and tight underwear, especially spandex or nylon underwear, can trap moisture against your body, allowing bacteria to thrive. Thong underwear is also problematic, said Dr. Kaufman. It "acts as a scaffolding for bacteria to 'climb' to the vagina." Your best bet is to wear breathable cotton underwear and loose clothing.

Dehydration

In a 2019 study conducted to help reduce UTI prevalence in care homes, researchers investigated the effects of increasing water intake for residents across four homes. They found that, compared to the previous year, there was a 58% reduction in antibiotic use for UTIs and a 36% reduction in hospital admissions for UTIs.

Further, the authors noted that "(a)fter 12 months of the intervention, the days between UTIs increased" and after 18 months, 80 days passed without UTIs in any of the four care homes in the study.

Staying well hydrated lowers your risk for UTIs because you'll have to pee more often. When you pee regularly, it helps flush out bacteria that could be sitting in your bladder, said Dr. Kaufman.

Wet Bathing Suits or Sweaty Workout Clothes

Just like certain types of underwear, wet bathing suits and sweaty workout clothes can trap and hold moisture against your body, allowing bacteria to thrive. That's why you should follow the recommendation of changing out of your wet suit as soon as you can.

A Quick Review

UTIs can happen to anyone, and there are several different UTI causes. Some things that may lead to a UTI are kidney stones, wiping incorrectly, uncontrolled diabetes, and wet or tight clothing.

Knowing the potential causes of UTIs—and actively working to prevent them—can go a long way toward keeping you pain-free in the future. However, if you find that you're still having UTI problems, talk with a healthcare provider.

Was this page helpful?
9 Sources
Health.com uses only high-quality sources, including peer-reviewed studies, to support the facts within our articles. Read our editorial process to learn more about how we fact-check and keep our content accurate, reliable, and trustworthy.
  1. Abelson B, Sun D, Que L, et al. Sex differences in lower urinary tract biology and physiology. Biology of Sex Differences. 2018;9(1):45. doi:10.1186/s13293-018-0204-8

  2. MedlinePlus. Kidney stones.

  3. National Institute of Diabetes and Digestive and Kidney Diseases. Eating, diet, & nutrition for kidney stones.

  4. Lelie‐van der Zande R, Koster ES, Teichert M, Bouvy ML. Womens’ self‐management skills for prevention and treatment of recurring urinary tract infection. Int J Clin Pract. 2021;75(8). doi:10.1111/ijcp.14289

  5. Office on Women's Health. Urinary tract infections.

  6. Sapra A, Bhandari P. Diabetes mellitus. In: StatPearls. StatPearls Publishing; 2022.

  7. Bono MJ, Leslie SW, Reygaert WC. Urinary tract infection. In: StatPearls. StatPearls Publishing; 2022.

  8. Centers for Disease Control and Prevention. Contraception.

  9. Lean K, Nawaz RF, Jawad S, Vincent C. Reducing urinary tract infections in care homes by improving hydration. BMJ Open Qual. 2019;8(3):e000563. doi:10.1136/bmjoq-2018-000563

Related Articles