How to Keep a Hard On: Exercise, Diet, and More

Maintaining a firm erection comes down to healthy blood flow, the right mental state, and a few lifestyle factors that are surprisingly easy to adjust. Difficulty staying hard affects 5% to 10% of men under 40 and becomes more common with age, with moderate to complete erectile difficulty rising from about 22% at age 40 to 49% by age 70. Whether this is an occasional frustration or a recurring pattern, the strategies below can make a real difference.

What Keeps an Erection Going

An erection depends on a chemical called nitric oxide. When you’re aroused, nerve signals trigger nitric oxide release in the penis, which relaxes the smooth muscle tissue inside the shaft. That relaxation lets blood rush in and fill two spongy chambers. As those chambers expand, they compress the veins that would normally drain blood back out, trapping it in place. That’s what keeps you hard.

Anything that interferes with nitric oxide production, blood flow, nerve signaling, or that venous trapping mechanism can make it harder to stay erect. The good news is that most of those factors respond well to lifestyle changes.

Cardio Exercise Has the Biggest Impact

Aerobic exercise is one of the most effective things you can do. A review of 11 randomized controlled trials involving over 1,000 men with mild or moderate erectile difficulty found that men who exercised for 30 to 60 minutes, three to five times a week, saw meaningful improvement compared to men who didn’t exercise. Walking, running, and cycling were the most common activities studied. Harvard Health has noted that regular aerobic activity may work as well as medication for some men.

The reason is straightforward: cardio keeps your blood vessels flexible, lowers blood pressure, and improves the body’s ability to produce and use nitric oxide. You don’t need to train for a marathon. Brisk walking counts, and consistency matters more than intensity.

Strengthen Your Pelvic Floor

The muscles at the base of your pelvis play a direct role in trapping blood inside the penis during an erection. Strengthening them through Kegel exercises can improve firmness and help you stay hard longer. According to the Mayo Clinic, the routine is simple: squeeze the muscles you’d use to stop urinating midstream, hold for three seconds, then relax for three seconds. Work up to 10 to 15 repetitions per set, three sets a day.

It takes a few weeks of consistency before you’ll notice a difference. The hardest part is finding the right muscles. Practice by actually stopping your urine flow once or twice to identify the sensation, then do the exercises at other times throughout the day. You can do them sitting, standing, or lying down, and nobody will know.

Foods That Support Blood Flow

Since nitric oxide is the key chemical behind erections, eating foods that boost its production can help. Beets are one of the most potent options. They’re rich in dietary nitrates that your body converts directly into nitric oxide. One study found that a beet juice supplement increased nitric oxide levels by 21% within 45 minutes. Leafy greens like spinach, arugula, and kale work through the same nitrate pathway.

Dark chocolate contains flavanols that help maintain optimal nitric oxide levels. A study of 16 people found that eating 30 grams of dark chocolate daily for 15 days significantly increased blood levels of nitric oxide. Nuts and seeds are high in arginine, an amino acid your body uses to produce nitric oxide. A study of nearly 2,800 people linked higher arginine intake from foods to higher nitric oxide levels in the blood.

Citrus fruits support the process differently. Vitamin C increases nitric oxide’s bioavailability, meaning your body absorbs and uses more of what it produces. Garlic activates the enzyme responsible for converting arginine into nitric oxide. Pomegranate protects nitric oxide from breaking down too quickly. None of these foods are magic bullets on their own, but a diet that regularly includes them gives your vascular system better raw materials to work with.

How Alcohol Undermines Erections

Alcohol works against you in multiple ways. It inhibits the part of your nervous system responsible for relaxing smooth muscle in the penis, which is the exact mechanism an erection depends on. It also dilates blood vessels throughout your body, causing a temporary drop in blood pressure that reduces the blood flow needed to fill and maintain an erection. On top of that, alcohol slows your central nervous system and alters brain chemicals involved in arousal.

One or two drinks may not cause problems for most men, but the more you drink, the more these effects stack up. If you’re noticing erection issues and you drink regularly, cutting back is one of the fastest experiments you can run.

Sleep and Testosterone

Testosterone plays a supporting role in sex drive and arousal, and sleep is when your body produces most of it. A meta-analysis found that going 24 hours or more without sleep significantly reduces testosterone levels. The drop was even larger after 40 to 48 hours of total sleep deprivation. Short-term partial sleep loss (like getting six hours instead of eight for a night or two) didn’t show a statistically significant drop in the same analysis, but chronically short sleep adds up over time.

If you’re consistently sleeping fewer than seven hours, improving your sleep is one of the simplest ways to support your hormonal health and, by extension, your erections.

Managing Performance Anxiety

The mental side of erections is just as real as the physical side. Once you lose an erection during sex, worrying about it happening again creates a feedback loop. Anxiety activates your fight-or-flight system, which constricts blood vessels and directly opposes the relaxation response an erection requires.

A few approaches can break this cycle. Shifting your focus to physical sensations, music, or what turns you on (rather than monitoring whether you’re still hard) helps take the pressure off. Talking openly with your partner removes the layer of secrecy that makes anxiety worse. And being less self-critical matters more than most men realize. If the pattern persists, a therapist who works with sexual health concerns can help you identify and work through the underlying anxiety. This is common, treatable, and not something to feel embarrassed about.

Medications That Can Cause Problems

Several common prescription drugs interfere with erections. Blood pressure medications are among the most frequent culprits, with thiazide diuretics (water pills) being the most common class to cause issues, followed by beta-blockers. Many antidepressants and anti-anxiety medications also affect erectile function, including widely prescribed SSRIs and benzodiazepines.

If you started a new medication and noticed a change in your erections, that connection is worth exploring with whoever prescribed it. There are often alternative medications in the same class that have fewer sexual side effects. Never stop a prescribed medication on your own, but know that this is a routine conversation your doctor has had many times before.

Constriction Rings

A constriction ring (sometimes called a cock ring) fits around the base of the penis and helps trap blood inside once you’re erect. It’s a simple, non-medical option that can help you stay harder longer, particularly if your issue is losing firmness partway through sex rather than not getting hard at all.

The key safety rule: never wear one for more than 30 minutes. Beyond that, reduced blood circulation can cause cell damage. Remove it immediately if you notice numbness, coldness, pain, unusual swelling, or any blue or pale discoloration. Stretchy silicone rings are easier and safer to remove than rigid metal ones, especially if you’re trying one for the first time.

Putting It Together

Most erection difficulties stem from a combination of factors rather than a single cause. A man who’s sleeping poorly, not exercising, drinking several nights a week, and feeling anxious about performance has multiple things working against him. The flip side is encouraging: improving even two or three of those factors often produces a noticeable difference. Start with the changes that feel easiest (more sleep, less alcohol, a daily walk) and build from there.