We include products we think are useful for our readers. If you buy through links on this page, we may earn a small commission Here’s our process.

Medical News Today only shows you brands and products that we stand behind.

Our team thoroughly researches and evaluates the recommendations we make on our site. To establish that the product manufacturers addressed safety and efficacy standards, we:
  • Evaluate ingredients and composition: Do they have the potential to cause harm?
  • Fact-check all health claims: Do they align with the current body of scientific evidence?
  • Assess the brand: Does it operate with integrity and adhere to industry best practices?
We do the research so you can find trusted products for your health and wellness.
Was this helpful?

If a person wants to get harder erections, making lifestyle and dietary changes and communicating with sexual partners may all help. People should work with healthcare professionals to find the best solution.

In some cases, persistent erectile problems may be a symptom of an underlying psychological or medical condition. Certain medications can also cause problems with getting and maintaining an erection.

This article will examine some options to help improve erectile function and when to see a doctor.

Problems getting or maintaining an erection is called erectile dysfunction (ED). ED is a common, usually treatable condition in which a person cannot get or maintain an erection long enough for sexual activity. It often affects males over the age of 40, but it can occur at any age.

Some people with ED can get an erection, but it may not last long enough for sex, and they may not be able to get an erection every time they want to have sex. Other people may not be able to develop an erection at all.

ED can be a symptom of tiredness, stress, or an underlying health condition. While this may be a physical health condition in older males, younger males may be more likely to develop ED due to psychological problems.

Many different factors can cause ED, including:

A healthcare professional may suggest making lifestyle changes or taking medication. Below are 14 options those looking to get harder erections can try.

If someone has trouble getting or maintaining an erection, they should speak with a doctor. They can discuss possible causes, run tests, and prescribe medication if necessary.

Seeking treatment may also help prevent potential complications of ED, such as:

  • a lack of enjoyment in their sex life
  • a loss of intimacy in a relationship
  • depression
  • anxiety
  • low self-esteem
  • difficulties conceiving

Eating a diet that supports heart health may also help support penile health.

According to a European Society of Cardiology congress study, following the Mediterranean diet could help maintain erectile function.

The same risk factors for heart disease, such as obesity and high blood pressure, can also increase the chance of erectile dysfunction. Adopting a Mediterranean diet may help reduce cardiovascular risk factors.

A Mediterranean diet consists of:

  • plenty of fruit and vegetables
  • nuts
  • whole grains
  • legumes, such as lentils, peas, and beans
  • olive oil
  • a moderate intake of fish
  • a moderate amount of alcohol, such as a glass of wine with a meal
  • a low intake of dairy and meat
  • a low intake of candy

Learn more about foods for better sex.

Foods to avoid

Research has shown that eating an inflammatory diet can increase a person’s risk of having trouble with their erections. Some pro-inflammatory foods could include:

  • saturated fats
  • red and processed meats
  • refined flour
  • sugar
  • eggs
  • white fish
  • soda
  • refined grains in bread, pasta, and white rice

A person should speak with a doctor before making changes to their diet.

Research involving over 20,700 men over the age of 40 suggests that exercise can help prevent erectile dysfunction, while a lack of physical activity can negatively affect erectile function.

Exercise increases blood flow to the penis, as well as to the rest of the body. Researchers suggest people participate in 40 minutes of supervised aerobic exercise four times per week.

Learn more about exercises that may help treat erectile dysfunction.

Emotional and psychological factors can affect sexual performance. If there is no underlying physical health condition affecting erectile function, mental and emotional factors may be the cause.

These could include issues such as:

  • traumatic previous sexual experiences
  • a lack of attraction to a partner
  • feeling anxiety or pressure to perform well sexually

Sexual performance anxiety is a common cause of sexual problems. Although there has not been much research into potential treatments, cognitive behavior therapy, mindfulness, and meditation may all help.

Talking to a sexual partner about any issues may help improve erectile function and relieve a person’s pressure. Seeing a sex therapist, with or without a partner, may also help people resolve any issues.

Learn more about sex anxiety.

Sex does not have to be penetrative to be pleasurable, and anecdotal sources suggest that exploring new approaches to sex may positively affect erections.

For example, the following things may help a person get and keep harder erections:

  • using a penis ring or sex toys
  • focusing less on sexual performance and more on pleasurable sensations
  • trying role-play or foreplay to increase arousal
  • exploring erogenous zones such as the ears, lips, neck, breasts, nipples, buttocks, and inner thighs

A 2018 study showed that alcohol can decrease penile sensitivity by depressing the central nervous system and slowing down information from the brain to the penis.

Limiting or avoiding alcohol may help improve erectile function. A person may wish to consider planning a romantic occasion without alcohol or increasing the period they go without alcohol.

Anyone concerned about alcohol misuse or alcohol use disorder (AUD) should speak with a doctor.

Research suggests that disrupted sleep, a lack of sleep, and sleep disorders can all affect sexual function. Sleep may affect erectile function, and there are links between erectile dysfunction and sleep disorders.

A 2020 animal study looked at the link between testosterone levels and sleep. The study showed that sleep restriction reduced testosterone levels, which play an important role in sexual behavior and libido. However, results from animal studies may not be fully applicable to humans.

According to a 2020 human study, sleep deprivation equal to or more than 24 hours can also decrease testosterone levels, but short-term sleep deprivation may not have significant negative effects.

Ensuring good quality sleep may help reduce the chance of erectile dysfunction and improve sexual function. People can improve their sleep by keeping their sleep schedule consistent, their sleep environment dark, quiet, and at a comfortable temperature, and avoiding screen use before sleep.

Learn more about how to improve sleep.

Stress releases cortisol, a hormone that helps regulate blood pressure and circulatory systems. Chronic stress can affect the male reproductive system and may lead to:

  • changes in testosterone production, causing a reduction in sex drive or desire
  • erectile dysfunction

Managing and reducing stress may help improve erectile function. A person may find that the following can help:

  • getting regular physical activity
  • having a social support network
  • getting good quality sleep each night
  • trying relaxation and mindfulness techniques

Smoking can reduce blood flow to the penis and increase the chance of erectile dysfunction. Smoking can harm the blood vessels, and it has a link to heart and blood vessel disease, which can also affect erectile function.

Reducing or quitting smoking may help improve erectile function and reduce the chance of experiencing problems.

Certain supplements may help improve erections, according to one 2020 review, yohimbe, Panax ginseng, and maca featured heavily in scientific research about medicinal plants for ED. However, the authors noted that results of the 369 studies they reviewed produced mixed results, and they concluded that more research is needed to understand the efficacy and safety of botanicals for ED.

However, the U.S. Food and Drug Administration (FDA) cannot approve dietary supplements or their labeling before companies sell them. This means companies sometimes sell supplements with misleading labels or undisclosed ingredients.

Additionally, supplements can interact with medication and cause side effects.

People should always consult a medical professional before trying a supplement to improve or treat a health condition. They should stop taking a supplement and speak with a doctor if they experience side effects.

Learn more about herbs for treating erectile dysfunction.

Some medications can help people get and keep an erection by increasing blood flow to the penis. These medications include:

  • sildenafil (Viagra)
  • vardenafil (Levitra, Staxyn)
  • tadalafil (Cialis)
  • avanafil (Spedra)

However, people should avoid taking any of the above if they also take nitrate medication or alpha-blockers.

Erectile dysfunction may also be a side effect of some medications, such as:

  • antiandrogens
  • antidepressants
  • blood pressure medications
  • sedatives or tranquilizers
  • appetite suppressants
  • ulcer medications

Certain drugs, such as illegal substances, may also hurt erectile function.

People should speak with a doctor if they think their medication negatively affects their sexual function.

Maintaining a moderate weight through regular exercise and eating a balanced and nutritious diet can play a part in maintaining healthy erectile function.

Being overweight can be a risk factor for diabetes, and uncontrolled blood sugar levels from diabetes can cause damage to the nerves and blood vessels. Nerve damage and poor circulation can reduce blood flow to the penis, making it more difficult to get a hard or long-lasting erection.

People with diabetes can help treat erectile dysfunction by managing their blood sugar levels and blood pressure.

Losing weight may help prevent erectile dysfunction by:

  • reducing inflammation
  • increasing testosterone levels
  • increasing self-esteem if it their weight impacts this

Testosterone levels can play a part in erectile function and sex drive. If a person has a testosterone deficiency, they may have the following symptoms:

A person with low testosterone levels can discuss treatments and potential side effects with a doctor. The doctor may prescribe testosterone for people to take by mouth, through the nose, or under the skin.

At the time of publication, the FDA only approved testosterone medication for people with low testosterone levels and an associated medical condition.

Please note that the writer of this article has not tried these products. All information presented is purely research-based and correct at the time of publication.

Medical News Today follows a strict product selection and vetting process. Learn more here.

People can order ED medication online from several telehealth companies. These include:

PricesMedications offered
Hims$3–$139 per doseViagra, sildenafil, Cialis, tadalafil, Stendra, Vardenafil
Roman$4–$90 per doseViagra, sildenafil, Cialis, tadalafil, daily tadalafil
Lemonaid Healthfrom $2 per dose, plus a one-time $25 consultation feesildenafil, tadalafil, daily tadalafil
BlueChew$2.65 per dose to $5 per dose, or starting at $20/monthchewable forms of sildenafil, tadalafil, or vardenafil

Below, we answer some of the most frequently asked questions about getting a harder erection.

Why is my erection not as strong as it used to be?

Physical and psychological factors can cause changes in a person’s erection. Age, sexuality, underlying health conditions, and a person’s relationship with their partner can affect their erection. Medication side effects can also hurt a person’s erection.

People experiencing difficulty getting or maintaining an erection should speak with a doctor.

Why do I have a firm erection when I masturbate but not with a partner?

A person who can have firm erections when alone but not with a partner may have sexual performance anxiety, which is a common concern. Counseling, meditation, and potentially some medications may help. Addressing any concerns, a person has with their sexual partner may also ease stress and anxiety.

Additionally, a person who prefers masturbation to sexual activity with a partner may be autosexual. This means that they primarily feel sexual attraction toward themselves. While autosexual people can feel sexual attraction toward and have sex with others, they may prefer to engage in sexual activity alone.

What causes a weak erection?

Many factors contribute to erection problems, including diet, exercise, medication, age, and underlying health conditions such as diabetes, heart disease, depression, and sleep disorders.

How long can the average male stay erect?

Typically, an erection may last from a few minutes to half an hour. However, there is no set duration for an erection; many factors can influence how long a person’s erection lasts.

Can I get ED medication without seeing a doctor?

No. A person must speak with a doctor and get a prescription to get ED medication. If a person finds it difficult to access regular doctor appointments, they can consider telehealth companies offering online appointments.

A person may be able to get harder erections by making certain dietary and lifestyle changes, as well as having open conversations with their sexual partner. Taking certain medications or supplements may also help.

If a person is experiencing persistent erectile problems, they can talk to a doctor to determine the cause.

In some cases, erectile problems could indicate an underlying condition. Treating or managing that condition can often help treat erectile dysfunction.