Outside the US? Find us where you live.

Fact checked Fact checked
How to stop an erection

How to stop an erection

You might have found yourself wondering how to lose an erection if you’ve got one at an inappropriate or potentially embarrassing time. A random erection is one that occurs at a time when you’re not sexually stimulated or “in the mood.”

Random erections are more often associated with teenagers and the process of puberty, but they can occur in men of any age. Some men also struggle to get or maintain an erection; this is common and normal too. It’s when ED starts to impact you consistently and negatively that it might be worth discussing your symptoms with a medical professional.

Daniel Atkinson
Medically reviewed by
Daniel Atkinson, Clinical Reviewer

“Random erections are more often associated with teenagers and the process of puberty, but they can occur in men of any age.”

Go to
Medically reviewed by
Dr Daniel Atkinson
Clinical Reviewer
on September 27, 2022.
Meet Daniel  
Was this article useful?
2 people found this helpful

Why do we get erections unexpectedly?

If you’ve ever found yourself standing to attention without explanation, you’re not alone. Random erections are common and usually not something to worry too much about. If you’ve ever wondered how to have a healthy penis, random erections could be a sign that everything is working as it should be.

One type of random erection is one which occurs in the night, known as nocturnal penile tumescence (NPT). You may also have woken with an erection, colloquially referred to as morning wood. NPT is common and typically occurs three to five times in average, healthy men. Nighttime erections can last for between 25 and 35 minutes , and are associated with the rapid eye movement (REM) stage of sleep.

Random erections may also happen because of hormone levels. The levels of testosterone, a male sex hormone, can fluctuate daily. It may be possible that as they rise and peak, random erections occur. Testosterone replacement has been trialed and studied as a treatment for erectile dysfunction, with mixed results.

But whatever the reason, the ability to get and maintain an erection, even randomly, is typically a sign that, physically, everything is working in order. Erections happen when the brain sends chemical messages to the blood vessels in the penis. They respond and dilate, which allows for blood to flow into the corpus cavernosum — two sponge-like chambers in the penis. One there, the vessels at the base of the penis constrict which should induce lasting rigidity and firmness.

For erections to happen, you generally need to have healthy circulation. If you experience random erections but also suffer with erectile dysfunction when you try to have sex, this could be indicative that your ED symptoms are more psychological in nature.

Erectile dysfunction
Want to know more about ED?

If you're struggling with ED symptoms, there's lots of different treatments to help. Let our clinical team support you to find the best one to suit your needs.

How to get rid of an erection

You might have wondered how to stop getting erections at inappropriate or potentially embarrassing times if you experience them. But there are some simple steps you can take to ensure it doesn’t happen, or that it subsides quickly if it does. From physical measures like taking a shower to psychological measures like practicing meditation techniques. Read on to find out how to not get an erection when you don’t want one.

Changing your position when you have a random erection might sound self-explanatory, but it actually has two functions.

Firstly, if you get a random erection at a potentially embarrassing or unwanted time, you can try and manoeuvre yourself to hide the erection and reduce how self-conscious you feel. This could include crossing your legs, for example.

But certain positions may also help to move pressure away from the blood vessels that supply the penis and induce an erection. The way you’re sitting may also inadvertently be stimulating, so changing position could help to reduce the effect of stimulation.

Another thing you may want to try if you have a random erection is changing your train of thought or distracting yourself.

For example, try thinking about something serious like your rent or mortgage, bills or work deadlines. Or you may want to think about something completely random or even humorous.

Meditation is an ancient practice derived from Buddhism. Research shows that regular meditation can be beneficial in a number of ways because it focuses on breathing techniques, the self and forgetting the material. Practicing mindfulness through breathing or chanting helps to cultivate “awareness of how the mind works and the ability to maintain focus.”

Meditation may also help with random erections because it shifts focus from the physical and external to the mind and the internal. This might sound hard to grasp in practice, so here’s a good way to get you started: 

  1. If you have a random erection, shift the focus to your breathing. 
  2. If you can, close your eyes. 
  3. Sit with your back straight and inhale through your nose for four seconds. 
  4. Hold your breath for seven seconds. 
  5. Exhale through your mouth for eight seconds. 
  6. Try to do this with a completely blank mind, don’t think of anything at all. (It’s harder than it sounds.) 

This is known as the “4-7-8 technique.” It might not always be practical to meditate fully, but focusing on your breathing alone is a subtle way of practicing meditation without drawing attention to yourself.

It has been posited that random erections which occur in the night may act as a mechanism to prevent you from urinating while you sleep. However, more research on the subject is needed. Most experts believe nocturnal penile tumescence is associated exclusively with the rapid eye movement (REM) stage of sleep, and has little to do with bladder function.

Either way, if you have a random erection, going to the toilet is a good method to try and help it subside. This is because you’re concentrating your mind on something else.

There’s actually quite a simple explanation for why it’s difficult to urinate with an erection. When you have an erection, the internal urethral sphincter contracts. It does this to prevent semen from entering the bladder, but also stops urine from passing through the urethra.

As your erection subsides, the internal urethral sphincter will relax and dilate, opening a passage for urine once again. This is why it’s possible to urinate while semi erect.

If you go to the bathroom with a random erection, concentrate on going to the toilet. If it helps, you can press (gently) and massage your bladder to promote the need to pee. Sooner or later, your mind will recognise that your bladder needs to empty, and the erection will naturally subside.

One technique that might work if it’s convenient for you is to have a warm bath or shower.
In their guidance on priapism (an erection that lasts for several hours and won’t go down), this is one of the approaches the government advises if you’re trying to reduce an erection.
A downside to this method is that taking a shower isn’t always practical, especially if you have a random erection in a public setting.

Another method to help alleviate a random erection is to simply sit and wait. Moving may inadvertently feel stimulating, and so not moving at all and waiting patiently might help the erection subside.

Just sit, relax and focus on your breathing — and remember, nobody is more conscious of your erection than you. So don’t panic; wait it out.

Erections happen because blood flows into the penis. One there, vessels at the base of the penis constrict which induces lasting firmness. This is all well and good, except when you don’t want it to happen and it does.

To try and get rid of an erection, focus on basic exercise. Exercise will get your blood pumping and the circulatory system will divert blood to other areas of the body, specifically those you’re targeting through physical activity. So a brisk walk would divert blood to the legs, pushups to the arms.

When is an erection a health risk?

Random erections are natural. Usually, they’ll go away on their own.

But, if you have an erection that doesn’t go away, this could potentially be a health risk. Specifically, if you have an erection that lasts for two hours or longer and is accompanied by pain or swelling, or an erection that lasts for four hours or longer and there is no pain, you need to call 911 or visit the hospital.

A painful erection that doesn’t go away is usually caused by a condition called priapism. Priapism can be caused by certain medications, like blood-thinners, antidepressants or recreational drugs, or it can be caused by certain health conditions such as blood disorders.

Priapism needs to be treated quickly to avoid lasting damage to the penis. One method of treatment involves draining blood from the penis while the area is numbed using local anaesthetic.

Some types of injectable treatments for erectile dysfunction can cause prolonged erections if the dose is too high. Again, if you get an erection that lasts for more than four hours after using treatment, it’s a medical emergency (so go to the hospital).

What does it mean if I get erections randomly, but can’t get them during sex?

Getting random erections, perhaps during the night or in the morning, but experiencing an inability to get them while you’re having sex is a clear sign of erectile dysfunction.

It could also point specifically to ED that is caused by psychological factors. If you experience random erections or nocturnal penile tumescence (NPT), this shows that physically, all the internal mechanisms which provide you with an erection are working in order. Your blood vessels are dilating, the penis is filling with blood, you’re experiencing lasting firmness and rigidity, and so on.

If you’re unable to get it up when you want to have sex, this shows you may have psychological ED. This can be a symptom of mental health conditions like depression, anxiety or PTSD. But it can also happen when you’re tired or because of things like panic or worry surrounding the idea of performance, relationship issues or stress.

If you get random erections but can’t get one during sex, the single best piece of advice we can give is to sit down with your partner and talk it through. Discuss what’s happening and any reasons you think might be causing it. If this doesn’t help, take it one step further and consider speaking with your doctor, a counsellor or a sexual health expert.

Talk to us about your health:

Help for erectile dysfunction

Erectile dysfunction can be complicated and difficult to understand, but it doesn’t have to be something you settle for. It is possible to reverse erectile dysfunction and get back to enjoying a healthy sex life.

How we source info.

When we present you with stats, data, opinion or a consensus, we’ll tell you where this came from. And we’ll only present data as clinically reliable if it’s come from a reputable source, such as a state or government-funded health body, a peer-reviewed medical journal, or a recognised analytics or data body. Read more in our editorial policy.

Reference Popover #ref1
Reference Popover #ref2
Reference Popover #ref3
Reference Popover #ref4
Reference Popover #ref5

Tell us what you want to hear.

Have a subject you’d like us to cover in a future article? Let us know.

Give us the inbox treatment.

We're making healthcare more about you. Sign up to our newsletter for personalized health articles that make a difference.

Disclaimer: The information provided on this page is not a substitute for professional medical advice, diagnosis, or treatment. If you have any questions or concerns about your health, please talk to a doctor.

Suggest a health guide

Tell us your idea here.

(And leave your email too, so we can let you know if we write an article based on your suggestion.)

What did you like about it?

What didn't you like about it?

Suggest a treatment

If there’s a particular treatment or condition you’re looking for, tell us and we’ll look into it for you.

We may email you about the problem, but you can opt out of these communications any time you like.

Ask or suggest something.

Submit your question here, or tell us if you’ve found an issue on our site.

We may email you about your query, but you can opt out of these communications any time you like.

Our average rating based on 8 reviews.

Tell us about a problem

I accept the terms of use.
We may email you about the problem, but you can opt out of these communications any time you like.

Is this your first time with us?

You can continue as a guest, or sign in with your Treated account if you have one. 


Our average rating based on 8 reviews.


Sign up to our newsletter for all the latest on Erectile Dysfunction and more.

By clicking 'Subscribe now' you're agreeing to our Privacy Policy.

You’re signed up to our newsletter. Keep an eye on your inbox for our latest update.

We’ll get back to you very soon. We aim to respond to all queries in one working day.