Most urinary tract infections in men cannot be prevented. Practicing safe sex by using condoms will help to prevent infections that are transmitted through sexual contact.
In men with benign prostatic hypertrophy, cutting out caffeine and alcohol or taking certain prescription medications may help to improve urine flow and prevent the buildup of urine in the bladder, which increases the likelihood of infection. Many men with urinary infections due to an enlarged prostate gland require surgery to remove part of the gland. Because this surgery can improve urine flow, it can help prevent infections.