How to Get a Harder Erection: Diet, Exercise, and More

Erections depend on blood flow. When you’re aroused, nerves in the penis trigger the release of a signaling molecule called nitric oxide, which relaxes the smooth muscle inside the two sponge-like chambers that run the length of the shaft. As those chambers fill with blood and expand against the outer membrane, the penis becomes rigid. Anything that disrupts blood flow, nerve signaling, hormone levels, or mental arousal can make this process harder to kick off or sustain. The good news: most of those factors are within your control or treatable.

How Erections Actually Work

The process starts in the brain. Visual cues, physical touch, or even a stray thought sends signals down the spinal cord to nerves concentrated in the penis. Those nerves produce nitric oxide, which sets off a chemical chain reaction that relaxes the smooth muscle lining the two internal chambers (the corpora cavernosa). Relaxed muscle means the arteries open wide, blood rushes in, and the chambers inflate. A second wave of nitric oxide, produced by the blood vessel lining itself, helps sustain the erection once blood flow picks up. Both phases need to work together for full rigidity.

This is why erection quality is often treated as a barometer of cardiovascular health. The arteries feeding the penis are small, so they’re among the first to show the effects of plaque buildup, high blood pressure, or inflammation. Problems getting hard can show up years before the same vascular issues affect the heart.

Exercise Is the Strongest Lifestyle Fix

Aerobic exercise improves erections through the same pathway that medications target: it boosts nitric oxide production and keeps blood vessels flexible. Clinical trials testing exercise for erectile problems typically used 30 to 60 minute sessions, three to five times per week, over a median of six months. The activities varied (brisk walking, cycling, jogging), but the common thread was sustained cardiovascular effort, not just lifting weights.

You don’t need to train like an athlete. Regular moderate cardio, the kind where you’re breathing hard but can still hold a conversation, is enough to measurably improve vascular function. Resistance training helps too, particularly for testosterone support, but cardio is the bigger lever for blood flow.

Foods That Support Blood Flow

A Mediterranean-style diet, heavy on vegetables, fruits, nuts, whole grains, olive oil, and fish, has the most evidence behind it for erectile health. In one randomized trial, men who followed this eating pattern for two years showed significant improvements in both erectile function and blood vessel health compared to a control group. The likely mechanism: plant compounds called polyphenols and omega-3 fats from fish increase nitric oxide availability in penile arteries while lowering inflammation.

A few specific foods stand out. Extra virgin olive oil contains compounds that directly stimulate nitric oxide production. Walnuts are rich in L-arginine, a building block your body uses to make nitric oxide, along with plant-based omega-3s. Leafy greens like spinach and arugula are high in dietary nitrates, which your body converts into nitric oxide through a separate pathway. Dark chocolate, berries, and citrus fruits deliver flavonoids that protect blood vessel lining. None of these are magic bullets on their own, but the cumulative effect of eating this way consistently is real.

Sleep and Testosterone

Testosterone doesn’t directly cause erections, but it primes the system. It maintains the nerve sensitivity, libido, and nitric oxide signaling that make erections possible. Your body produces most of its testosterone during deep sleep, and cutting that short has immediate consequences. Research from the University of Chicago found that healthy young men who slept only five hours per night saw their testosterone drop by 10 to 15 percent. That’s a significant hit, roughly equivalent to aging 10 to 15 years in terms of hormone levels.

Seven to nine hours is the target. If you’re regularly getting less than six and noticing weaker erections, especially fewer morning erections, poor sleep is a prime suspect. Morning erections are driven by overnight hormonal cycles, so their absence can signal that something is off with sleep quality, testosterone, or both.

Pelvic Floor Exercises

The muscles at the base of the pelvis play a direct role in trapping blood inside the penis during an erection. Strengthening them through Kegel exercises can improve rigidity and help you maintain erections longer. The technique is simple: squeeze the muscles you’d use to stop urinating midstream, hold for a few seconds, then release. Aim for 10 repetitions, three times a day.

Consistency matters more than intensity here. Most men notice changes after six to eight weeks of daily practice. Kegels are especially useful for men who can get hard but lose firmness quickly, since that pattern often points to pelvic floor weakness rather than a blood flow problem.

Managing Performance Anxiety

Your brain is part of the erection pathway, and anxiety is remarkably effective at shutting it down. When you’re stressed or self-conscious, your nervous system shifts into fight-or-flight mode, which constricts blood vessels and diverts blood away from the penis. This creates a feedback loop: one failed erection makes you anxious about the next one, which makes failure more likely.

Breaking the cycle starts with taking penetration off the table temporarily. Focusing on other ways to give and receive pleasure, using hands, oral sex, or toys, removes the pressure that’s fueling the anxiety. Talking openly with your partner about what’s happening helps too. Most partners respond with understanding, and the act of naming the anxiety out loud reduces its power. If the problem traces back to deeper relationship issues or past trauma, working with a therapist who specializes in sexual health can be particularly effective.

One practical in-the-moment technique: redirect your attention to physical sensations rather than monitoring your erection. Focus on what your skin feels, what your partner’s body feels like, the temperature in the room. This shifts your nervous system away from the anxious, evaluative mode that kills arousal.

Supplements Worth Knowing About

L-citrulline is the supplement with the most plausible mechanism for erection support. Your body converts it into L-arginine, which then becomes nitric oxide. L-citrulline is actually better absorbed than taking L-arginine directly, because L-arginine gets partially broken down in the gut before it reaches the bloodstream. Doses used in studies go up to 6 grams per day, though optimal dosing hasn’t been firmly established for erectile function specifically.

Other supplements you’ll see marketed for erections, like horny goat weed, maca, or tribulus, have much weaker evidence. Some show modest effects in small studies, but nothing approaching the reliability of exercise, diet changes, or medication. Be cautious with anything sold as a “natural Viagra” online, as these products are frequently found to contain unlabeled pharmaceutical ingredients.

When Medication Makes Sense

PDE5 inhibitors (the class that includes sildenafil and tadalafil) work by amplifying the nitric oxide signal your body is already producing. They don’t create arousal on their own; they make it easier for arousal to translate into a full erection. Sildenafil is typically taken 30 to 60 minutes before sex and lasts four to six hours. Tadalafil lasts much longer, up to 36 hours, and can be taken daily at a low dose so you don’t have to plan around it.

These medications are effective for roughly 70 percent of men who try them, across a wide range of underlying causes. They’re available by prescription, and in many places now through telehealth platforms. If lifestyle changes alone aren’t getting results after a few months, medication is a reasonable next step rather than a last resort.

Red Flags to Take Seriously

Occasional difficulty getting or staying hard is normal, especially after drinking, when stressed, or when sleep-deprived. It becomes worth investigating when it happens consistently over several weeks or months.

One situation requires emergency medical attention: an erection lasting longer than four hours that won’t go down, known as priapism. This is a medical emergency. Blood trapped in the penis for that long becomes oxygen-deprived, and without treatment, the result can be permanent tissue damage and loss of erectile function. This is rare and most commonly associated with certain medications or blood disorders, but if it happens, go to an emergency room immediately.