I had small ones in my tank with dwarf seahorses. I don't think they attacked them in any way, but I used one of those small green bristleworm traps to keep their numbers low. I don't think you can truly get rid of them, just control them.
They are beneficial to a sandbed and clean up detirius. However they give me the willies and I don't like them.
Are they in a big seahorse tank or dwarf? I had a
orchid dottyback clean out the ones in my main tank. My wife had a Arabian dottyback do the same. But the Arabians seem to be a bit too temperamental for seahorses but the smaller orchids or those neon ones (blue) may do okay. If it is a dwarf tank, then I would not use any fish, just a bristle worm trap. They are about 6 bucks in any lfs. But instead of the freeze dried stuff they give you for bait, use frozen krill, frozen mysis, or the like. Don't be surprised at all the little
brittle stars you catch as well.
Ray