The 31-year-old was previously out of contract at the end of the campaign. He joined Wakefield from Salford Red Devils ahead of the 2015 season and has gone on to make over 100 appearances at Trinity.
The second-rower made his professional debut with St Helens in 2009 before joining Salford in 2012.
“I’m delighted to have signed a new deal to remain at Trinity," said Ashurst.
“I’ve thoroughly enjoyed my seven seasons here at the club and couldn’t imagine playing anywhere else now.
“For me it was a no-brainer to extend and to continue the journey. The club know me and I know them, it was an easy decision.
“I’m really enjoying my rugby this season and now I want to kick on and continue to do my best for the team week in and week out.”
Head coach, Chris Chester added: “To get Tash signed up for a further two years is extremely pleasing news.
“I can’t speak highly enough of him throughout my time here. He’s been a brilliant player for Wakefield Trinity and will continue to be for the next few years.
“He’s a real calming influence for us on that left-edge and has a really good understanding with the other guys that play around him.
“I’m delighted that he’s sticking around and look forward to continuing to work with him.”