The 30-year-old moved to Luton on loan from Leyton Orient back in January 2017, scoring three goals for the Hatters in 18 appearances.
He then went to Lincoln City, netting 11 times the following season, before a switch to Crawley Town, scoring 30 times in 76 matches.
Palmer was then signed by the Dons in August 2020, but has suffered with injury, on target 13 times in 52 fixtures, including eight this season.
However, Wrexham, recently taken over by Hollywood owners Ryan Reynolds and Rob McElhenney, have made their move, with a statement on the AFC Wimbledon official website saying: "AFC Wimbledon has reluctantly accepted an offer of £300,000 for our striker Ollie Palmer after the player insisted he wanted to leave the club.
"Ollie will join National League outfit Wrexham, whose new Hollywood owners are investing heavily in a bid to get their club back into the Football League.
"We are naturally disappointed to see Ollie leave and wish the 30-year-old every success for the remainder of his career."
Chief executive Joe Palmer continued: “Wrexham offered a substantial fee for Ollie - and also made him an irresistible personal offer.
“In the end, though, it was entirely Ollie’s decision to leave.
"We couldn’t have offered him anywhere near what he was being offered and the last thing we wanted to do was force him to stay against his will.
"That wouldn’t have been in anyone’s best interests.”
Palmer himself added: "I just want to say a massive thank-you to each and every one of you.
"You’ve helped me grow as person and been a second family to me. I got to say a few goodbyes this morning and obviously in the players' group chat.
"I wish you nothing but the absolute best this season, what a club to play for, and thank you for everything.”