Content
Enjoy sex like you used to
Reviewed by Kelly Brown MD, MBA
Written by Geoffrey C. Whittaker
Published 05/04/2022
Updated 05/06/2024
While not all sexually transmitted diseases (STDs) are linked to erectile dysfunction (ED), there are some STDs that cause erectile dysfunction — at least indirectly. STDs such as gonorrhea, chlamydia, viral hepatitis and HIV can cause infections in your prostate, which may affect your erections and ability to have sex.
Below, we discuss how infection can cause erectile dysfunction and which STDs may impact your sexual function and ability to get an erection. We also offer some tips on what you can do if you have ED, from using prescription medication to making changes to your lifestyle and more.
Content
While the majority of STDs don’t appear to have any direct impact on your ability to get an erection, some may cause or contribute to other health issues that can cause ED. Specifically, STDs — also known as sexually transmitted infections (STIs) — like HIV, viral hepatitis, gonorrhea and chlamydia may cause infections that could trigger erectile dysfunction.
For example, some infections spread through sex have the potential to cause prostatitis, a form of inflammation that affects your prostate gland. If this inflammation becomes severe, there’s the risk it could make it difficult for you to maintain an erection firm enough for sex.
Prostatitis can also cause other urinary and sexual symptoms, including pain while urinating or ejaculating. These issues can affect both your sexual functioning and day-to-day quality of life.
In addition to affecting your prostate gland, some sexually transmitted diseases can cause male accessory gland infections (MAGIs). These infections may result in inflammation and damage to your urethra, epididymis, testes and seminal vesicles, which in turn can have a negative effect on sexual function and fertility.
Even sexually transmitted diseases that don’t physically cause erectile dysfunction may have a significant effect on your psychological well-being, including your level of confidence in bed.
Researchers have found that having an STD can have an adverse psychological impact on the sexual function of men. This may include issues like sexual performance anxiety, as well as a general decrease in sex drive and avoidance of sexual encounters.
In other words, even when an STD doesn’t physically stop you from getting an erection, it could cause you to develop psychological erectile dysfunction.
In some cases, yes. Gonorrhea — a bacterial infection that spreads through sexual contact — is one of several bacterial STDs that can spread to your prostate gland and cause you to develop the symptoms of erectile dysfunction.
Common symptoms of gonorrhea in men include:
White, yellow or green discharge from the penis
Pain, discomfort and a burning sensation when urinating
Swollen and/or painful testicles
Gonorrhea is treatable with antibiotics, making it important to talk to your healthcare provider if you start to experience any of the above symptoms.
Because chlamydia can spread to the prostate gland, it also has the potential to cause prostatic inflammation that may contribute to or be a cause of ED.
Chlamydia is an infection caused by the bacteria Chlamydia trachomatis. Like other STDs, it’s typically spread through sexual contact.
Not all people who have chlamydia develop symptoms. Men with symptomatic chlamydia may experience pain or tenderness that affects the testicles, a burning sensation while urinating and discharge from the penis and/or rectum.
Like gonorrhea, chlamydia is treatable. It’s important to talk to your healthcare provider as soon as possible if you notice any of the symptoms of chlamydia after sexual activity.
Other STDs may play a role in the development of chronic health issues that affect your sexual health and contribute to long-term sexual dysfunctions.
For example, hepatitis C (or other forms of viral hepatitis) is associated with an increased risk of several forms of cancer, including prostate cancer. Although prostate cancer doesn’t directly cause ED, most forms of treatment for prostate cancer, including surgery, can contribute to erectile dysfunction.
Other sexually transmitted diseases, such as HIV, can attack your immune system and prevent it from functioning properly. This may increase your risk of developing infections that affect the penile tissue, causing erectile dysfunction.
Currently, there’s limited evidence that syphilis or human papillomavirus (HPV) have any impact on erections. However, one study has found that the herpes simplex virus (HSV) is associated with an increased risk of erectile dysfunction.
Catching a sexually transmitted disease can be a stressful and frustrating experience — especially when it also causes you to develop erectile dysfunction.
The good news is that erectile dysfunction and most STDs are curable, usually with a course of antibiotics and changes to your habits. Below, we discuss what you can do if you have a sexually transmitted disease that you think is causing erectile dysfunction.
Many STDs can have a negative impact on your health if they’re left untreated. Some can even contribute to infertility, either for you or your sexual partner. Further, the longer you wait to treat an STD, the more opportunities you have to potentially transmit it to other people.
Because of this, it’s important to treat your sexually transmitted disease before you even start to think about treating erectile dysfunction.
If you think you have an STD, it’s important to talk to your primary care provider as soon as you can. Most STDs can be checked for with a simple test, allowing you to find out if you have anything (and if so, what it is) within a few days.
If you have a sexually transmitted disease, your primary care provider may prescribe medication to cure the infection and restore your normal sexual health.
It’s also important to get tested for STDs on a frequent basis if you’re sexually active and to practice safe sex.
If you still find getting an erection difficult after treating an STD, you may want to consider using ED medication to improve your erections and sexual performance. Currently, four medications are available to treat ED: sildenafil (the active ingredient in Viagra®), tadalafil (Cialis®), vardenafil (Levitra®) and avanafil (Stendra®).
These medications, which belong to a class of drugs called PDE5 inhibitors, work by increasing blood flow to your genital region and penis. This improvement in blood flow can make it easier to get and maintain an erection sufficient for satisfying, pleasurable sex.
In addition to treating any sexually transmitted diseases and using ED medication, there are a simple changes you can make to your habits and daily life that can also improve your erectile health:
Get plenty of physical activity, even if it just means going for a daily walk or bike ride.
Maintain a healthy body weight, especially if you’re currently overweight or obese.
Eat a healthy, balanced diet that’s rich in fresh fruits, vegetables and lean proteins.
If you have hypertension (high blood pressure) or diabetes, keep them under control.
Limit your alcohol intake by drinking in moderation and avoiding irresponsible drinking, as this can be among the causes of erectile dysfunction.
Avoid using illicit drugs, as these may affect your sex drive and sexual function.
If you smoke, make an effort to quit to improve your cardiovascular wellbeing.
Consider working with a therapist if you’re dealing with anxiety or depression, as mental health and ED are connected.
Our list of ways to protect your erections naturally shares other lifestyle changes and healthy habits to explore for better erections and sexual performance.
Sexually transmitted diseases can have a serious impact on your health. In some cases, they can even affect your ability to get and maintain an erection.
If you think you might have gonorrhea, chlamydia or any other STD, it’s important to speak to your healthcare provider as soon as possible. They’ll be able to test you for any STDs and, if necessary, prescribe medication to get rid of the infection.
In addition to getting yourself tested and treated, it’s also important to let your recent partners know about your current situation, especially if you have an STD that could cause infertility or long-term health problems.
If your erectile dysfunction persists after you treat your STD, you may want to consider taking medication to improve your erections. We offer a range of proven ED medications, which are available following an online consultation with a licensed healthcare provider.
Hims & Hers has strict sourcing guidelines to ensure our content is accurate and current. We rely on peer-reviewed studies, academic research institutions, and medical associations. We strive to use primary sources and refrain from using tertiary references. See a mistake? Let us know at [email protected]!
Dr. Kelly Brown is a board certified Urologist and fellowship trained in Andrology. She is an accomplished men’s health expert with a robust background in healthcare innovation, clinical medicine, and academic research. Dr. Brown was previously Medical Director of a male fertility startup where she lead strategy and design of their digital health platform, an innovative education and telehealth model for delivering expert male fertility care.
She completed her undergraduate studies at University of North Carolina at Chapel Hill (go Heels!) with a Bachelor of Science in Radiologic Science and a Minor in Chemistry. She took a position at University of California Los Angeles as a radiologic technologist in the department of Interventional Cardiology, further solidifying her passion for medicine. She also pursued the unique opportunity to lead departmental design and operational development at the Ronald Reagan UCLA Medical Center, sparking her passion for the business of healthcare.
Dr. Brown then went on to obtain her doctorate in medicine from the prestigious Northwestern University - Feinberg School of Medicine and Masters in Business Administration from Northwestern University - Kellogg School of Management, with a concentration in Healthcare Management. During her surgical residency in Urology at University of California San Francisco, she utilized her research year to focus on innovations in telemedicine and then served as chief resident with significant contributions to clinical quality improvement. Dr. Brown then completed her Andrology Fellowship at Medical College of Wisconsin, furthering her expertise in male fertility, microsurgery, and sexual function.
Her dedication to caring for patients with compassion, understanding, as well as a unique ability to make guys instantly comfortable discussing anything from sex to sperm makes her a renowned clinician. In addition, her passion for innovation in healthcare combined with her business acumen makes her a formidable leader in the field of men’s health.
Dr. Brown is an avid adventurer; summiting Mount Kilimanjaro in Tanzania (twice!) and hiking the incredible Torres del Paine Trek in Patagonia, Chile. She deeply appreciates new challenges and diverse cultures on her travels. She lives in Denver with her husband, two children, and beloved Bernese Mountain Dog. You can find Dr. Brown on LinkedIn for more information.
Education & Training
Andrology Fellowship, Medical College of Wisconsin
Urology Residency, University of California San Francisco
M.D. Northwestern University Feinberg School of MedicineB.S. in Radiologic Science, Chemistry Minor, University of North Carolina at Chapel Hill
Published as Kelly Walker
Cowan, B, Walker, K., Rodgers, K., Agyemang, J. (2023). Hormonal Management Improves Semen Analysis Parameters in Men with Abnormal Concentration, Motility, and/or Morphology. Fertility and Sterility, Volume 118, Issue 5, e4. https://www.sciencedirect.com/journal/fertility-and-sterility/vol/120/issue/1/suppl/S
Walker, K., Gogoj, A., Honig, S., Sandlow, J. (2021). What’s New in Male Contraception? AUA Update Series, Volume 40. https://auau.auanet.org/content/update-series-2021-lesson-27-what%E2%80%99s-new-male-contraception
Walker, K., Shindel, A. (2019). AUA Erectile Dysfunction Guideline. AUA Update Series, Volume 38. https://auau.auanet.org/content/course-307
Walker, K., Ramstein, J., & Smith, J. (2019). Regret Regarding Fertility Preservation Decisions Among Male Cancer Patients. The Journal of Urology, 201(Supplement 4), e680-e681. https://www.auajournals.org/doi/10.1097/01.JU.0000556300.18991.8e
Walker, K., & Smith, J. (2019). Feasibility Study of Video Telehealth Clinic Visits in Urology. The Journal of Urology, 201(Supplement 4), e545-e545. https://www.auajournals.org/doi/10.1097/01.JU.0000556071.60611.37