Rees, who took over the Welsh captaincy from Ryan Jones last autumn, had been undergoing intensive treatment with the aim of managing the injury and avoiding surgery.
But that path has failed to bring the results Rees and the Wales medical staff were looking for and the 30-year-old will now have surgery to correct the problem.
"Matthew will not be available for selection after losing his race for fitness from a persistent neck injury," said Prav Mathema, national medical performance manager for the Welsh Rugby Union.
"The safety and longevity of Matthew's career is paramount. We are all very disappointed that Matthew will not be with us in the World Cup but his health is at the fore of our decision.
"Following a series of injections and intensive treatment and rehabilitation the decision has been made to omit him from the squad to allow him to undergo surgery.
"The medical teams of both the Scarlets and the WRU concluded unanimously to proceed with surgery."
The news is a third successive blow for Wales coach Warren Gatland, who has also seen full back Morgan Stoddart and centre Gavin Henson ruled out of selection for his 30-man squad that is due to be announced on August 22.
Lloyd Burns of the Dragons started Saturday's victory over England in Cardiff but he was part of a Welsh front row that were outplayed by their English counterparts.
Huw Bennett helped sure up the setpiece when he was introduced as a replacement and could now be in line to start this weekend's final World Cup warm up against Argentina at the Millennium Stadium.
Bennett's Ospreys team-mate and hooking rival Richard Hibbard did at least give Gatland something to smile about after it was announced that he has been officially added to the training squad after fully recovering from shoulder surgery.
Hibbard will now compete with Bennett, Burns and Rees' Scarlets understudy Ken Owens for a World Cup berth.