Riley, who started his career with Wolves and also had a spell with Shrewsbury Town, before making his breakthrough with Kidderminster Harriers, where he made 68 appearances.
He also went on to have spells with Cheltenham Town, Mansfield Town and Wrexham as well as spending last season with Stourbridge in the Southern Premier Central division.
Hednesford boss Keenen Meakin-Richards said: “We wanted some more experience in the squad and nobody is more experienced than Martin Riley.
“We are excited to bring him in and really feel he will add that strength and aggression to the team”.
Riley arrives after a poor run of form for the Pitmen, who went down 4-1 at Peterborough Sports in midweek and were going into to today’s home clash with Leiston looking for their first win in seven matches.
Hednesford this week announced they had released defender Kyle Rowley and midfielder Aram Soleman as they look to get back to winning ways.