Walmsley, 21, has penned a three-year deal at Langtree Park having impressed playing in the Championship this season.
Saints chairman Eamonn McManus said: “Alex is one of the most promising and exciting prospects in the game and we are delighted to have secured his services ahead of stiff competition from other clubs.
“He is a powerful forward who we have no doubt will suit Saints style of play. We look forward to welcoming him into the Club.”
Walmsley has represented Great Britain Students, while studying at Leeds Met university, and was playing for Dewsbury Celtic before catching the eye of the Batley club.
He may not have played his last game with the Bulldogs, however – he is expected to join them on a dual-registration deal for next season.