The well travelled stopper, who arrived at the club in 2020, has made a handful of appearances this season in the absence of Sam Johnstone.
And he took over the number one spot in the final few games of the season with Johnstone's contract set to run out ahead of his exit.
Button, 33, who previously turned out 134 times for Brentford, is one of three goalkeepers at the club alongside Alex Palmer and Josh Griffiths, with boss Steve Bruce previously saying the trio will battle it out for the number one spot.
On signing his new deal, Button said: “It’s a privilege to play for such a big club with great fans and great staff members behind the scenes.
“I’m really looking forward to the next two years here.
“Despite not playing as much as I would have liked, I’ve really enjoyed my last two years here.
“When I knew the club wanted to offer me a new deal it was a really easy decision to make.”