You may have pain during a bowel movement due to constipation or another health issue. If you notice blood in your stool and have other symptoms, it could be an indicator of something more serious.

Feeling some pain when you poop isn’t uncommon. Your diet, daily activities, and emotional state can all affect what it feels like to go number two, and the pain may only be temporary.

But some conditions that make pooping an uncomfortable chore are more serious and may require a visit to the doctor. Read on to learn what conditions may need medical treatment and what you can do to help relieve and prevent symptoms.

Anal fissures are tiny cuts that happen when anus skin cracks and often bleeds.

Symptoms include:

  • an area near your anus that looks torn
  • skin outgrowth near the tear
  • stinging or intense pain near your anus when you poop
  • blood in your poop or on toilet paper when you wipe
  • anal itchiness
  • burning sensation around your anus

They’re not too serious and usually go away without medical treatment in a little over a month.

Some treatments for anal fissures include:

  • taking stool softeners
  • hydrating with water and water-rich foods
  • eating about 20 to 35 grams of fiber per day
  • taking a sitz bath to improve blood flow and help muscles relax
  • applying hydrocortisone cream or ointment to reduce inflammation
  • using pain relief ointments, such as lidocaine, to reduce pain

Hemorrhoids, sometimes called piles, happen when the anus or rectum veins become swollen.

You may not notice an internal hemorrhoid in your anus, but external hemorrhoids can cause pain and make it hard to sit without discomfort.

Symptoms include:

  • pain when you poop
  • intense anal itching and pain
  • lumps near the anus that hurt or feel itchy
  • anal leakage
  • blood on toilet paper when you poop

Try the following treatments and prevention tips for hemorrhoids:

  • Take a warm bath for 10 minutes each day to relieve pain.
  • Apply topical hemorrhoid cream for itching or burning.
  • Eat more fiber or take fiber supplements, such as psyllium.
  • Use a sitz bath.
  • Wash your anus every time you bathe or shower with warm water and a gentle, unscented soap.
  • Use soft toilet paper when you wipe. Consider using a bidet for gentler cleansing.
  • Apply a cold compress to help with swelling.
  • Take nonsteroidal anti-inflammatory drugs (NSAIDs) for pain, including ibuprofen (Advil) or naproxen (Aleve).

More serious hemorrhoids may need to be surgically removed.

Constipation happens when you poop less than three times a week, and when you do, the poop comes out hard and with more trouble than usual. Pain is usually less sharp and may accompany pain in your lower gut from backup.

Common symptoms include:

  • hard, dry stool that comes out in small chunks
  • anus or gut pain while you poop
  • still feeling like you need to poop even after you go
  • bloating or cramping in your lower gut or back
  • feeling like something’s blocking your intestines

Follow these treatments and prevention tips for constipation:

  • Drink plenty of water — at least 64 ounces a day — to stay hydrated.
  • Reduce your caffeine and alcohol intake.
  • Eat plenty of fiber or take fiber supplements.
  • Eat foods with probiotics, such as Greek yogurt.
  • Reduce your intake of foods that can cause constipation, such as meat and dairy.
  • Get about 30 minutes of light exercise, such as walking or swimming, every day to keep your bowels moving.
  • Go to the bathroom as you feel it coming to keep stool from getting hard or stuck.
  • Try laxatives for severe cases but talk to your doctor before you take them.

Proctitis happens when the lining of your rectum, the tube where bowel movements comes out, becomes inflamed. It’s a common symptom of sexually transmitted infections (STIs), radiation treatments for cancer, or inflammatory bowel conditions such as ulcerative colitis.

Symptoms include:

  • pain when you poop
  • diarrhea
  • bleeding when you poop or wipe
  • mucuslike discharge from your anus
  • feeling like you have to poop even if you’ve just gone

Here are some treatment and prevention tips:

  • Use condoms or other protection when you have sex.
  • Avoid sexual contact with someone who has visible bumps or sores in their genital area.
  • Take any prescribed antibiotics or antiviral medications for infections, such as doxycycline (Vibramycin) or acyclovir (Zovirax).
  • Take any prescribed medications for radiation side effects, such as mesalamine (Canasa) or metronidazole (Flagyl).
  • Take over-the-counter stool softeners to help soften stool.
  • Take prescribed medications for inflammatory bowel diseases, such as mesalamine (Canasa) or prednisone (Rayos), or immunosuppressants such as infliximab (Remicade).
  • Get surgery to remove any damaged areas of your colon.
  • Get treatments like argon plasma coagulation (APC) or electrocoagulation.

Inflammatory bowel disease (IBD) refers to any condition that involves inflammation in your digestive tract. This includes Crohn’s disease, ulcerative colitis, and irritable bowel syndrome. Many of these conditions result in a lot of pain when you poop.

Common symptoms include:

  • diarrhea
  • feeling exhausted
  • pain or discomfort in your belly
  • blood in your poop
  • losing weight for no reason
  • not feeling hungry, even when you haven’t eaten for a while

Some treatments and prevention tips for IBD include:

  • anti-inflammatory medications, such as mesalamine (Delzicol) or olsalazine (Dipentum)
  • immunosuppressants, such as azathioprine or methotrexate (Trexall)
  • medications to control your immune system, such as adalimumab (Humira) or natalizumab (Tysabri)
  • antibiotics for infections, such as metronidazole (Flagyl)
  • diarrhea medications, such as methylcellulose (Citrucel) or loperamide (Imodium A-D)
  • pain medications, such as acetaminophen (Tylenol)
  • iron supplements to limit anemia from intestinal bleeding
  • calcium or vitamin D supplements to lower your risk of osteoporosis from Crohn’s disease
  • removal of parts of your colon or rectum, leaving a small pouch from your small intestine to your anus or to the outside of your body for collection
  • a low-meat, low-dairy, moderate-fiber diet with small amounts of caffeine and alcohol

Diarrhea happens when your bowel movements are thin and watery.

Diarrhea doesn’t always make pooping hurt. But wiping a lot and passing a lot of stool can irritate skin and make your anus feel raw and sore.

Symptoms include:

  • nausea
  • stomach pain or cramps
  • feeling bloated
  • losing too much fluid
  • blood in your poop
  • needing to poop often
  • fever
  • a large volume of stools

Treatment for diarrhea usually consists of rehydration, inserting an intravenous line if necessary, or antibiotics. Here are some prevention tips for diarrhea:

  • Wash your hands for at least 20 seconds with soap and water before and after you eat.
  • Wash and cook food properly, eat it right away, and put leftovers in the fridge quickly.
  • Ask your doctor about antibiotics before you visit a new country.
  • Don’t drink tap water when you travel or eat food that’s been washed with tap water. Only use bottled water.

Endometriosis happens when the tissues that make up the lining of the uterus, known as the endometrium, grow outside the uterus. They can attach to your colon and cause pain from irritation or scar tissue formation.

Other symptoms include:

  • pain during your period
  • lower abdominal or back pain and cramps before your period starts
  • heavy menstrual flow
  • pain during or after sex
  • infertility

Some treatments include:

  • pain medications, such as ibuprofen (Advil)
  • hormone therapy to regulate growth of tissues
  • birth control, such as medroxyprogesterone (Depo-Provera) injections, to mitigate tissue growth and symptoms
  • gonadotropin-releasing hormone (GRNH) to reduce estrogen that causes tissue growth
  • minimally invasive laser surgery to remove tissue
  • last resort surgical removal of the uterus, cervix, and ovaries to stop menstruation and tissue growth

STIs such as chlamydia or syphilis spread through anal sex can result in bacterial infections that cause your rectum to swell and make it painful to poop.

Both STIs are spread through unprotected sexual contact with someone who’s infected, and painful rectal swelling can also accompany symptoms like burning when you pee, discharge from your genitals, and pain during sex.

Some treatment and prevention tips for these STIs include:

  • antibiotics, such as azithromycin (Zithromax) or doxycycline (Oracea)
  • penicillin injections for severe syphilis
  • abstaining from sex while you’re being treated for either STI
  • using protection whenever you have sex, including oral or anal sex
  • getting tested for STIs regularly if you’re sexually active

Human papillomavirus (HPV) is a viral infection that can cause warts to form near your anus, genitals, mouth, or throat. Anal warts can get irritated when you poop, making you feel a rawness or stinging pain.

Untreated HPV can cause anal and cervical cancer. HPV can’t be fully cured. Warts may come and go, and your doctor may use laser or cryotherapy to remove warts. Make sure you get tested for STIs and for cancer regularly if you have an HPV diagnosis.

Prevention tips for HPV include:

  • getting the HPV vaccine if you’re under age 45
  • using condoms every time you have sex
  • getting Pap smears and regular health and STI screenings

It’s highly unlikely that anal cancer or rectal cancer is the culprit for painful pooping, but it’s a small possibility. Some symptoms that may indicate cancer include:

  • sudden, abnormal changes in poop color or shape
  • small, thin stool
  • blood in your poop or on toilet paper when you wipe
  • new or unusual lumps near your anus that hurt when you apply pressure to them
  • itchiness around your anus
  • unusual discharge
  • frequent constipation or diarrhea
  • feeling unusually exhausted
  • having a lot of gas or bloating
  • losing abnormal amounts of weight
  • constant pain or cramps in your abdomen

See your doctor right away if you notice any of these symptoms. Early treatment can help stop the spread of cancer and limit complications.

Treatment for these cancers may include:

  • chemotherapy injections or pills to kill cancer cells
  • surgery to remove anal or rectal tumors and prevent cancerous tissue from spreading, possibly removing the entire rectum, anus, and parts of your colon if cancer has spread
  • radiation treatment to kill cancer cells
  • regorafenib (Stivarga) for advanced rectal cancer to stop cancer cell growth

Seek immediate medical attention if you have:

  • pain or bleeding lasting for a week or more
  • fever or unusual fatigue
  • unusual bleeding or discharge when you poop
  • pain or other symptoms after sex, especially with a new partner
  • intense abdominal or back pain and cramps
  • newly formed lumps near your anus

Painful poops may just be a temporary case of diarrhea, constipation, or hemorrhoids that go away in a few days — none of these causes are usually serious.

See your doctor if bowel movements are painful for a few weeks or the pain is sharp and intense enough to disrupt your everyday life. Sudden, unusual changes in your stool should also prompt a doctor’s visit.