The 38-year-old scored 18 goals in all competitions last season during his solitary season at Oakwell.
McGoldrick now moves to the Stags, who saw off competition from other clubs, including Barnsley themselves, for the signing of the veteran frontman.
MORE: Ex-Town loanee added to England World Cup squad
He now links up with Nigel Clough’s side, who finished 10th in the third tier in 2025/26.
The former Republic of Ireland international will be the second ex-Blue in the ranks at One Call Stadium, with former Town full-back Elliott Hewitt having extended his stay last month.
Mansfield become the 12th club of McGoldrick’s professional career, one that has spanned 22 years so far.
The skilful frontman bagged 45 goals in 159 goals for Town during his five years at Portman Road between 2013 and 2018.
McGoldrick’s list of clubs so far…
Notts County
Southampton
AFC Bournemouth (loan)
Port Vale (loan)
Nottingham Forest
Sheffield Wednesday (loan)
Coventry City (loan)
Ipswich Town
Sheffield United
Derby County
Barnsley
Mansfield Town
