Try
the exterminate command for DFhack by typing in its creature token. It should clear up any present traces of hamsters on the map at a given time, though vermin might flash in and out.
exterminate HAMSTER
Something something, with great power comes responsibility, especially when you could accidentally point-destroy all your citizens with a misfire.
Animal stockpiles aren't fussy on the material of the cage or animal trap (with or without animal present, the criteria only prioritizes the animal), theres not really any reason why they wouldnt use the metal animal-trap/cages unless they're inaccessible somehow from the area they're stored & forged from, possibly through faulty stockpile links. You can however influence the rough kind of traps that are stored.
- All metal traps/cages & elven grown cages are listed under 'additional options' as non-organic, while wood cages are the opposite, disabling one or the other enables/disables flow of those types being filtered there.
In the build screen you can lay down animal traps (its something like a alt key click over J i forget, its labeled on the building side panel), which metal ones generally can handle all kinds of vermin, and can be baited. Or from a butcher/kennels have a trapper dwarf set out to find vermin around the fort trap in hand, which you can coax them into a working area using burrows you last saw vermin you want to capture
- A working part of farming cave spiders & silk, the silk collection is also are in a operation burrow, with trappers working to re-capture any loose specimens, and cats on chains posted outside the collection rooms secure hallway.
Cats and rodent-hunting falcons might be your best bet against hamsters, though once you have the hamsters caught you can display their cute little chubby cheeks inside terrariums along with other cages (though i've heard that maybe glass cages called terrariums enable more observation of vermin via them and aquariums being one and the same item, that's speculation)