Objective To investigate the effect of virtual reality (VR) sham feeding on gastrointestinal function in elderly patients with hip fracture. Methods Elderly patients with hip fracture admitted to Trauma Center, West China Hospital, Sichuan University between June and December 2024 who met the case selection criteria were selected. Patients who were willing to complete the postoperative VR operation were assigned to the experimental group (VR group), and the other patients were assigned to the control group by 1∶1 manual interval matching according to sex, age (±5 years), and body mass index (±2 kg/m2). The control group received fasting and nutrition management strategy during perioperative period of accelerated rehabilitation. In the VR group, VR sham feeding intervention was performed on the basis of the control group. The time of first postoperative exhaust and defecation, postoperative gastrointestinal symptoms, postoperative nutrition (hemoglobin, serum albumin) and inflammatory indicators (white blood cell count, erythrocyte sedimentation rate, C-reactive protein, interleukin-6), postoperative appetite and postoperative complications (bleeding, fever, delirium, aspiration, vertigo) were compared between the two groups. Results A total of 70 patients were enrolled, with 35 in each group. There were statistically significant differences (P<0.05) between the VR group and the control group in the time of postoperative first exhaust [(9.17±4.81) vs. (13.66±5.97) h], time of postoperative first defecation [(49.00±28.61) vs. (66.83±29.93) h], degree of abdominal distension 3 d after surgery (grade 0/1/2: 26/7/2 vs. 16/12/7 cases), appetite score 1 d after surgery (62.86±12.85 vs. 54.71±11.50), appetite score 3 d after surgery (76.29±9.95 vs. 62.43±8.86), albumin level 3 d after surgery [(33.18±3.41) vs. (31.40±3.07) g/L], and hospitalization days [(7.97±1.38) vs. (9.06±2.43) d], while there was no statistically significant difference in other indicators (P>0.05). Conclusions The incidence of postoperative gastrointestinal dysfunction is high in elderly patients with hip fracture. VR sham feeding can promote the early recovery of gastrointestinal function, alleviate postoperative abdominal distension, significantly improve postoperative appetite, and increase albumin level after surgery.