We evaluated the mesenteric elasticity in patients undergoing continuous ambulatory peritoneal dialysis (CAPD) using shear wave elastography (SWE) and investigated its relationships with peritoneal function. Patients were recruited in our peritoneal dialysis (PD) centre between 15 July 2019 and 31 December 2021 and followed up to 31 March 2022. Twelve chronic kidney disease (CKD) patients and nineteen healthy people were included as controls. Correlation, linear regression and Cox regression analyses were applied. Of the 218 PD patients, 104 (47.8%) were male. Their mean age was 48.0±13.2years and the median PD duration was 59.0months [interquartile range (IQR) 17.0-105]. The median mesenteric SWE value was 8.15kPa (IQR 5.20-16.1). The mesenteric SWE values of patients with a PD duration of <3months [5.20kPa (IQR 3.10-7.60)] were not significantly different from those of CKD patients [4.35kPa (IQR 2.63-5.20), P=.17] and healthy controls [3.60kPa (IQR 2.90-5.10), P=.13] but were lower than those of patients with a PD duration of 3months-5years [6.40kPa (IQR 4.10-10.5), P<.001], 5-10years [11.9kPa (IQR 7.40-18.2), P<.001] and >10years [19.3kPa (IQR 11.7-27.3), P<.001]. Longer PD duration (β=0.58, P<.001), high effluent interleukin-6 (β=0.61, P=.001) and low effluent cancer antigen 125 (β=-0.34, P=.03) were independently associated with low mesenteric elasticity. The mesenteric SWE value was independently correlated with the dialysate:plasma creatinine ratio (β=0.39, P=.01) and negatively correlated with the total daily fluid volume removed (β=-0.17, P=.03). High mesenteric SWE values were an independent risk factor for death-censored technique failure [adjusted hazard ratio 4.14 (95% confidence interval 1.25-13.7), P=.02). SWE could be used to non-invasively characterize peritoneal textural changes, which were closely associated with changes in peritoneal function.