"I have had wonderful support from the High Performance Sport medical team. In the end we all acknowledged that surgery was the only option," Boyle said.
"I am grateful for the selectors for their vote of confidence for Budapest but these last couple of months have been dark times with this injury, and I am pleased to finally have it sorted."
The New Zealand squad will continue with their preparations before a final camp in Austria ahead of the world championships which start on July 20.
The news is unfortunate for Swimming New Zealand who have suffered funding cuts from High Performance Sport New Zealand in recent years.
They received $1.5 million in 2014, a figure that steadily dropped to $900,000 this year.
The sport was punished for failing to get a finalist and/or a medallist at the Rio Olympics, but met 24 other key performance indicators in their strategic plan.
In the lead-up to the Games, Boyle had been touted to become the first New Zealander since Danyon Loader in 1996 to earn a medal in the sport.
Illness in her preparation meant she was underdone. She missed the final by one spot in her 800m freestyle specialty.