Hansen said: "Sonny has got a busy schedule so we thought he'd be better having some time at home."
The World Cup gets underway in September and the All Blacks remain keen to give everyone in their 41 man squad a chance to stake their claim for the final 31.
"The boys have gone over to South Africa and it's a big challenge over there," Williams said. "I get to stay home I guess and get the body feeling good.
"Hopefully I'll get to go against Australia next time around. I struggled this year with a few niggling injuries but thank God the body's come right at the right time.
"I'm in All Black mode so I've got to try and make every opportunity I get now a winner."
Williams was one of the very few New Zealanders happy with the Roosters win as the Warriors were humbled in Sydney.
He played for them in 2013 and 2014 - helping them to become NRL minor premiers twice and they won the grand final in his first season.
Williams was speaking to former teammate Anthony Minichello on Roosters TV after the game.
"It's awesome and always good after a win like that from the boys. They're starting to look sharp - really sharp. It probably could have been 40-0 but the big think about it is the nil. The boys are looking really good and it's good to be back here."
The Roosters sit third in the NRL ladder and Williams is very confident they can win the grand final this year.
"They'd be my pick, even when we lost a few straight but they were by one or two points and I think our place on the ladder wasn't really showing how we were playing.
"They've been my pick all year and that won't change. I know the boys are going to do it."