The black worms are actually maggots, which eventually grow into what are known as moth flies. A leaking toilet or drainpipe is often the breeding ground for the moth fly, and they can be found in both residential and commercial environments. To get rid of them, eliminate their breeding site.
Identification of Black Worms
The black worms are not actually worms, but are the larval stage of moth flies, or drain flies. The worms remain in this stage of development for about 9 to 15 days. Homeowners often spot the worms when they return home after a lengthy absence, such as following a vacation. An adult moth fly is covered with dense, long hair on its body and wings, which gives it a resemblance to a moth. These flies often originate in the seldom-used drains of sinks, bathtubs and showers and floor drains, and from the always-moist surfaces under leaks. They feed on the excrement and film found inside the drains, as well as on the microscopic organisms inside the pipes and moist spots.
Annoyance or Danger?
Even though they breed and grow in filthy environments, there has been no evidence that these black worms transmit diseases to humans who use a toilet which has a worm infestation. The adult moth flies that the worms transform into in a couple of weeks neither bite nor sting humans, so their presence seems more a matter of being a nuisance than actually posing a danger to human health.
Identifying Moth Fly Infestation
Basically, the only way to identify a moth fly infestation inside the toilet drain is to trap and visually identify them. Finding the moth fly larva around the toilet may also indicate the presence of moth flies in other drains inside the bathroom. Place cling film around the base of the toilet, and also over the sink and tub or shower drain openings, without totally covering the opening. Check the cling film at certain intervals to see if moth flies have accumulated on the plastic, over a period of one or two days.
Eliminating the Worms
The best way to get rid of the black worms around the toilet is to eliminate the source of the leak, which eliminates the moth fly's breeding ground. Toilets commonly leak from the base of the toilet, when the wax ring fails. Repair this leak by lifting the toilet, removing the old wax and installing a new wax seal. Make sure there are no other possible leaks around the toilet, such as from the tank or from the water supply line connections.