Reclinic
Dr. Khanin
Home › Health articles › Joint replacement › Sleep, bowels and mood
Health article · Joint replacement · Recovery
After joint replacement:
poor sleep, constipation and low mood — what helps
In the first weeks after knee or hip replacement, many people sleep poorly, find it harder to open their bowels, or feel low, irritable or worried without knowing why. These problems are common, usually temporary, and can mostly be managed at home. This article explains why they happen, what you can do, and when to see a doctor.

Written and reviewed by Assoc. Prof. Khanin Iamthanaporn, MD
Orthopedic surgeon (license 35052) · Last reviewed November 2026 · About 6 min read
Education, abdominal massage and a laxative cut in-hospital constipation from 55%
to 25%
after hip replacement [4]
Why poor sleep, constipation or low mood after surgery?
After surgery your body is coping with pain, pain medicine, less movement and a changed routine all at once, so these three problems often come together and affect each other. Pooled studies show that people who sleep better around the time of surgery have less pain in the first days [6], while staying in bed for long periods and feeling anxious both raise the chance of constipation [7]. Improving one usually helps the others.
Most of this is temporary and gets better as pain settles and you walk more. It does not mean something has gone wrong with the operation.
Poor sleep after joint replacement
Studies using wrist-worn devices show that in the first days after surgery people sleep for shorter periods and wake more often, then gradually improve over the following days to weeks [8]. Common causes are night pain, not finding a comfortable position, getting up to the toilet and napping too much during the day. Pooled studies after knee replacement found that sleep usually improves after about 3 months, as pain eases [1].
Things that help you sleep better
✓ Take your prescribed pain medicine before bed Use a cold pack on the joint for 15–20 minutes as well. If pain keeps you awake for several nights, tell your doctor so the medicine can be adjusted. Read about pain after surgery →
✓ Find a comfortable position Knee: lie on your back with a pillow under the calf or heel so the knee stays straight; avoid a pillow under the knee. Hip (anterior approach): lie on your back or on either side; a pillow between the knees is optional, just for comfort — sleeping position does not affect the risk of the new hip dislocating. If you had surgery at another hospital, follow your own surgeon's advice.
✓ Keep day as day Get up at the same time each day, let in morning light, and walk and do your exercises during the day. Short naps are fine — napping does not worsen night-time sleep in older adults [9] — but keep them to 30 minutes or less, as regular longer naps are linked with heart disease and high blood pressure [10]. If you go to bed around 9–10 pm, have coffee, tea or energy drinks before noon: a single cup of coffee can still disturb sleep if taken within about 9 hours of bedtime [11].
✓ Make night-time trips to the toilet safe Keep a small light on along the way, keep your walking aid next to the bed, and drink less in the 2 hours before bed (drink enough during the day instead).
✓ Wind down before bed Slow, deep breathing, quiet music or prayer, and no phone in bed. Pooled studies show that non-drug measures — nurse-led care and education, a quiet dark room, and relaxation — improve sleep quality [12].
✓ Don't buy sleeping pills or melatonin yourself Randomized trials found that melatonin did not improve sleep after joint replacement [13]. Some sleeping pills help in the short term but have side effects [14], and sedating medicines increase the risk of falls after joint replacement [15]. If poor sleep is affecting your recovery, your doctor may prescribe a short course of a sleep aid for you.
If you still sleep badly for several weeks despite these steps, and are too tired to exercise during the day, tell your doctor.
Constipation after surgery
Constipation is common and can be very uncomfortable, especially while you are in hospital. Opioid pain medicines slow the bowel; across 15 studies about 4 in 10 people taking them became constipated [3]. Less movement, eating and drinking less, and an unfamiliar toilet also play a part. One study after hip replacement found a higher risk in people who stayed in bed for more than 48 hours, were prone to constipation before, were over 70, or were anxious [7]. Combining several types of pain medicine reduces the need for opioids; a study by Dr. Khanin and colleagues found that giving an anti-inflammatory medicine from before knee replacement reduced opioid use on the first day [16]. Once home, as you walk more and need less pain medicine, most people's bowels settle.
Walk often
Walking keeps the bowel moving. Get up and walk every 1–2 hours during the day as you can, along with your exercises, rather than staying in bed all day [7]. See the exercises after surgery →
Drink enough and eat fruit and vegetables
About 1.5–2 liters of water a day (6–8 glasses) unless your doctor has limited fluids for heart or kidney disease, with vegetables, fruit and whole grains at every meal — for example ripe papaya, oranges, guava, prunes and brown rice. A randomized trial found that enough fiber plus about 2 liters of water a day led to more frequent bowel movements and less laxative use than fiber alone [17].
Regular toilet time and abdominal massage
Try sitting on the toilet after breakfast each day, without rushing or straining hard. Use a sit-down toilet, or a commode chair placed over a squat toilet, in the early period; a low footstool can help if it is comfortable. Gentle clockwise abdominal massage for 10–15 minutes a day helped people open their bowels sooner in a randomized trial after knee replacement [18], and combined with education and a laxative it cut constipation after hip replacement from 55% to 25% [4].
Laxatives while in hospital
Constipation is most common during the hospital stay, when more pain medicine is used and walking is still limited, so your doctor gives a laxative during this time — the first step the American Gastroenterological Association recommends for constipation caused by opioids [19]. Most people do not need to keep taking a laxative after going home. If you are still constipated at home, ask a pharmacist or your doctor, and don't stop your pain medicine on your own because of constipation — more pain means less walking and exercise.
Doctors count fewer than 3 bowel movements a week as one feature of constipation [20]. If, after going home, you have not opened your bowels for more than 3 days despite these steps, talk to your doctor or pharmacist. Avoid using enemas or strong laxatives repeatedly without advice.
Low mood, irritability and worry after surgery
Many people feel sad, discouraged, tearful or irritable after surgery, especially in the first weeks when they are still in pain, short of sleep and relying on others more than usual. Some are afraid that moving will damage the new joint; pooled studies found this fear of movement in about 1 in 3 people after knee replacement, more often in those with more pain or less support [21]. The good news: one year after surgery, fewer people had depressive or anxiety symptoms after both hip and knee replacement [5]. Worry and very negative thoughts about pain are linked with pain that lasts longer [22][23], so caring for your mood is part of recovery.
Looking after your mood while you recover
✓ Set small goals and look at progress week by week Walking further, bending the knee more, or using the stick less. A day with more pain than yesterday is normal; compare with last week instead.
✓ Let family help, but not do everything Doing daily tasks yourself as you can, such as walking to the bathroom, showering or making a simple meal, builds confidence.
✓ See people and get some daylight Sit outside, talk with friends or family, or call someone close. It helps with feeling isolated during recovery.
✓ Ask when you're unsure Worrying whether a symptom is normal is always something you can ask your doctor about. Symptoms after knee replacement → · Hip →
✓ Keep taking your usual medicines If you are being treated for depression or anxiety, don't stop your medicine around surgery, and let the doctor who prescribes it know you have just had an operation.
If you feel sad, bored or not wanting to do anything for most of the day for more than 2 weeks, tell your doctor — it is treatable. In Thailand you can also call the Department of Mental Health hotline 1323 (Thai-language, 24 hours).
When to see a doctor
Increasing bloating, nausea or vomiting, not being able to eat, or no passing of wind for more than a day
The bowel may have stopped working after surgery [24]; this is uncommon and more likely in older people and after hip surgery [25]. Go to hospital promptly.
Blood in the stool or black stools
Especially if you take blood thinners or anti-inflammatory medicine. See a doctor straight away.
Several weeks of poor sleep, or night pain that keeps getting worse
See a doctor to find the cause and adjust your medicine. Read about pain after surgery →
New confusion, unusual drowsiness or not making sense
This can happen in older people after surgery, or when pain medicine and sleeping pills are taken together. Family should contact the doctor promptly.
⚠ Get help right away if you have
Thoughts of harming yourself, or a feeling that you don't want to live — call 1323 (24 hours) or 1669, or go to the nearest emergency department — and also if you suddenly become very short of breath or have chest pain. For other questions, contact Assoc. Prof. Dr. Khanin via LINE @khaninclinic or Facebook khaninortho.
Read more
Still in pain after joint replacement — is it normal?
Pain that is expected, how long it takes to ease, and when to get checked
Symptoms after hip replacement
Thigh numbness, uneven leg length and other symptoms after anterior hip surgery
Patient stories
Short clips of joint replacement patients describing their own recovery
Self-care after surgery
Wound care, exercises, reducing swelling and preventing infection at home
Symptoms after knee replacement
Swelling, tightness, numbness, bruising and other symptoms during recovery
Frequently asked questions
References
Akbal S, Yildirim M. Changes in sleep quality after total knee arthroplasty: a systematic review. Am J Nurs 2024;124(12):38–45.
Alipourian A, Farhadian N, Zereshki E, Khazaie H. Improvement of sleep quality 6 months after total knee arthroplasty: a systematic review and meta-analysis. J Orthop Surg Res 2021;16:342.
Kalso E, Edwards JE, Moore RA, McQuay HJ. Opioids in chronic non-cancer pain: systematic review of efficacy and safety. Pain 2004;112:372–380.
Yue C, Liu Y, Zhang X, Xu B, Sheng H. Randomised controlled trial of a comprehensive protocol for preventing constipation following total hip arthroplasty. J Clin Nurs 2020;29:2863–2871.
Duivenvoorden T, Vissers MM, Verhaar JAN, et al. Anxiety and depressive symptoms before and after total hip and knee arthroplasty: a prospective multicentre study. Osteoarthritis Cartilage 2013;21:1834–1840.
Shen SP, Wang YJ, Zhang Q, Qiang H, Weng XS. Improved perioperative sleep quality or quantity reduces pain after total hip or knee arthroplasty: a systematic review and meta-analysis. Orthop Surg 2021;13:1389–1397.
Zou L, Zheng XD, Wang CG, Ma T. Factors associated with constipation after total hip arthroplasty and nursing countermeasures. Medicine (Baltimore) 2025;104:e45226.
Ferrero A, Patrucco F, Marcolin MG, et al. Objective sleep disturbance after total hip and knee arthroplasty: a systematic review of wearable-derived metrics and targeted interventions. Arthroplast Today 2026;39:102013.
Souabni M, Souabni MJ, Hammouda O, et al. Benefits and risks of napping in older adults: a systematic review. Front Aging Neurosci 2022;14:1000707.
Wang L, Wang K, Liu LJ, et al. Associations of daytime napping with incident cardiovascular diseases and hypertension in Chinese adults: a nationwide cohort study. Biomed Environ Sci 2022;35:22–34.
Gardiner C, Weakley J, Burke LM, et al. The effect of caffeine on subsequent sleep: a systematic review and meta-analysis. Sleep Med Rev 2023;69:101764.
Salmani A, Khani Y, Abedi-Azar R, et al. Nonpharmacological interventions improve postoperative sleep in arthroplasty patients: a systematic review and meta-analysis. JBJS Rev 2025;13(11).
Razick DI, Akhtar M, Wen J, et al. Evaluating whether melatonin impacts postoperative sleep following total joint arthroplasty: a systematic review and meta-analysis of randomized controlled trials. Cureus 2026;18:e107734.
Namazi N, Salmani A, Ayati A, et al. Limited efficacy of pharmacological interventions for improving postoperative sleep quality in primary total joint arthroplasty patients: a systematic review and meta-analysis of randomized controlled trials. J Arthroplasty 2026;41:1291–1301.e2.
Wesselink EJ, van der Vegt M, Remmelzwaal S, et al. The impact of mental state altering medications on preventable falls after total hip or total knee arthroplasty: a systematic review and meta-analysis. Patient Saf Surg 2024;18:6.
Iamthanaporn K, Rojjanasirisawat N, Yuenyongviwat V. Superior analgesic efficacy of preemptive low-dose ketorolac compared with parecoxib after total knee arthroplasty: a retrospective propensity score matching study. J Orthop Surg (Hong Kong) 2024;32:10225536231225758.
Anti M, Pignataro G, Armuzzi A, et al. Water supplementation enhances the effect of high-fiber diet on stool frequency and laxative consumption in adult patients with functional constipation. Hepatogastroenterology 1998;45:727–732.
Durmuş İskender M, Çalışkan N. Effect of acupressure and abdominal massage on constipation in patients with total knee arthroplasty: a randomized controlled study. Clin Nurs Res 2022;31:453–462.
Crockett SD, Greer KB, Heidelbaugh JJ, et al. American Gastroenterological Association Institute guideline on the medical management of opioid-induced constipation. Gastroenterology 2019;156:218–226.
Mearin F, Lacy BE, Chang L, et al. Bowel disorders. Gastroenterology 2016;150:1393–1407.
Du X, Shao Y, Xue J, Kong J. Prevalence and influencing factors of kinesiophobia after total knee arthroplasty: a systematic review and meta-analysis. J Orthop Surg Res 2025;20:332.
Lewis GN, Rice DA, McNair PJ, Kluger M. Predictors of persistent pain after total knee arthroplasty: a systematic review and meta-analysis. Br J Anaesth 2015;114:551–561.
Li J, Guan T, Zhai Y, Zhang Y. Risk factors of chronic postoperative pain after total knee arthroplasty: a systematic review. J Orthop Surg Res 2024;19:320.
Vather R, Trivedi S, Bissett I. Defining postoperative ileus: results of a systematic review and global survey. J Gastrointest Surg 2013;17:962–972.
Ruiz Pardo J, Cobo Cervantes CE, Sánchez Fuentes PA, et al. Clinical and therapeutic management of Ogilvie syndrome in patients undergoing hip and knee surgery — a systematic review. Rev Esp Enferm Dig 2025;117:654–661.
The information in this article is for initial self-care and does not replace an examination and advice from a doctor.