Manager Mick McCarthy had initially ruled O'Hara out for a week, meaning the former Tottenham player missed Tuesday night's draw with Norwich and was set to sit out the Boxing Day game at Arsenal.
But the decision was then taken for the 25-year-old to undergo surgery, which was carried out in Manchester on Tuesday.
Steve Kemp, the head of Wolves' medical department, told the club's official website: "Jamie has been complaining of some groin pain for the last couple of months, which we have managed conservatively.
"We were able to manage it with treatment and he was able to play, but it got to a stage where a specialist decided that surgery would be needed.
"The decision was taken to have the surgery and get Jamie at 100% rather than continue to try to manage him through it. He's had a double hernia repair which was performed yesterday in Manchester and was successful.
"We hope he will be back in training within four to six weeks' time."
Source: PA
Source: PA