Darren John Jones, aged 49, of no fixed abode, was arrested in Castleford on May 19 after reports of a male causing damage in the town centre.
West Yorkshire Police officers responded and found Jones nearby.
A search of the nearby gardens revealed a hammer which was seized and was believed to be used in the offences.
Officers then retraced the journey Jones had taken on foot and found six premises where multiple windows had been smashed.
Jones was taken into custody and later interviewed. He was charged with six offences, which he admitted, and was remanded in custody.
He was also interviewed with regard to a number of previous incidents of damage but the evidence was not available to secure further charges.
Jones appeared at court on Friday May 20 and was given a four-month prison term.