The QPR, who last played on 9 March, uploaded a photo to his Twitter page which showed a heavily-bandaged right ankle.
The picture was accompanied by a message which read: "Had my ankle surgery - all went well. Thanx 4 your kind wishes truly appreciate it all."
A statement on the club website confirmed the 31-year-old will not be available until next term, and Harry Redknapp said: "It needed doing.
"We tried to keep him going but he's been playing with pain for a while now.
"It was an accumulation of problems. We wanted to keep him going but he just couldn't. He couldn't give his maximum with it."
Wright-Phillips was not in the squad for Monday's defeat at Fulham, but had been an unused substitute at Aston Villa in QPR's previous game.
Rangers are seven points short of safety with just seven games to play.