I'm not sure why you would do that.
I don't believe that is necessary as in the wild the fish would be eating the dirt as well as the worm and passing it naturally. My fish have shown no negative effects from eating worms covered in a light layer of dirt. Nor has my tank shown any detriment to having some dirt in it, which I usually just gravel clean with my next water change, it's a negligible amount. And if you have live plans they like it, extra nutrients.
I don't believe that is necessary as in the wild the fish would be eating the dirt as well as the worm and passing it naturally. My fish have shown no negative effects from eating worms covered in a light layer of dirt. Nor has my tank shown any detriment to having some dirt in it, which I usually just gravel clean with my next water change, it's a negligible amount. And if you have live plans they like it, extra nutrients.