How to Kill Fly Larvae and Keep Them From Coming Back

The fastest way to kill fly larvae is to pour water heated to at least 140°F directly onto them. Boiling water (212°F) kills maggots on contact. Beyond that, you have several effective options depending on where the infestation is and what you have on hand.

Fly larvae hatch from eggs within 8 to 20 hours and develop through three growth stages over four to seven days before becoming pupae. In warm summer months, the entire lifecycle from egg to adult fly takes just 7 to 10 days. That tight window means acting quickly prevents a small problem from becoming a recurring one.

Boiling Water and Vinegar

Boiling water is the simplest and most immediately effective option. Pour it slowly and deliberately over the larvae, making sure the water reaches every maggot. For trash cans, pour it down the inside walls so it coats the entire surface as it runs to the bottom. Water doesn’t technically need to be boiling to work. Anything above 140°F will kill larvae, but hotter is better since the water cools quickly once it hits a surface.

For a longer-lasting effect, mix one part white vinegar with three parts hot water. Pour this into the infested area, close the lid if you’re treating a trash can, and let it sit for 30 minutes. The vinegar helps neutralize the odors that attracted flies in the first place, which reduces the chance of new eggs being laid. The downside is that vinegar treatment needs to be repeated at least once a week to stay effective.

Salt and Diatomaceous Earth

Both salt and diatomaceous earth kill larvae by dehydrating them. Cover the maggots and the entire surrounding area with a thick, generous layer of table salt, then leave it in direct sunlight for about an hour. The combination of heat and salt pulls moisture out of the larvae and kills them.

Diatomaceous earth works similarly but through a different mechanism: the fine powder has microscopic sharp edges that cut through the larvae’s outer layer, causing them to dry out. For best results, make sure the area is as dry as possible before applying an even coating over the maggots. Leave it for several hours, then sweep up the dead larvae and powder and seal them in a plastic bag for disposal. Use food-grade diatomaceous earth, and avoid breathing in the dust while applying it.

Chemical Insecticides

Spray insecticides designed for crawling insects will kill maggots on contact. Look for products labeled for fly larvae or general-purpose pest sprays at your hardware store. For trash cans specifically, vapor-based insecticide pods that attach to the inside of your trash can lid offer a hands-off option. These release a slow, odorless vapor that kills existing larvae and prevents new infestations for up to four months.

Chemical options make the most sense when you’re dealing with a large or recurring infestation where manual methods like boiling water aren’t practical, or when larvae are hiding in hard-to-reach spots.

Killing Larvae in Drains

Drain flies lay eggs in the slimy organic buildup inside pipes, and their larvae feed on that film. Pouring boiling water or vinegar down the drain can kill visible larvae, but it won’t remove the breeding material clinging to the pipe walls. To actually solve the problem, scrub the inside of the drain with a stiff wire brush or pipe brush to physically remove the buildup, then flush with a drain cleaner. Without removing that organic layer, new eggs will hatch within days.

Overwatered potted plants can also breed small fly larvae (fungus gnats) indoors. Letting the soil dry out between waterings usually eliminates the problem since the larvae need moisture to survive.

Cleaning a Trash Can After Treatment

Killing the larvae is only half the job. Any residue left behind will attract new flies within days. After you’ve killed the maggots, remove all trash, loose debris, and anything not contained in a sealed bag. Scrub every surface inside the can with hot soapy water and a brush or sponge mop, getting into corners and crevices where organic residue collects. Rinse thoroughly with a garden hose, then dry the can completely with towels or let it air dry in the sun before putting any new bags in. A wet trash can with food residue is exactly the environment that starts the cycle over.

Preventing Larvae From Coming Back

Sanitation is the single most important factor. According to the Illinois Department of Public Health, eliminating the material flies are attracted to and lay eggs on is usually enough to prevent infestations entirely, and without thorough sanitation, other control methods are largely ineffective.

The practical steps are straightforward:

  • Seal your trash. Use bags tied shut inside cans with tight-fitting lids. Loose garbage or open containers are open invitations.
  • Clean regularly. Liquid from food waste leaks through bags and pools at the bottom of trash cans. Rinse your bin out every few weeks, or more often in summer.
  • Remove organic waste promptly. Food scraps, pet waste, and decaying plant material should be bagged and disposed of quickly, not left sitting.
  • Control moisture. Flies seek out damp environments. Fix leaks, drain standing water, and keep compost areas as dry as possible.
  • Keep bins away from doors. Place outdoor dumpsters and trash cans as far from building entrances as practical to reduce the chance of flies getting inside.

Larvae on Pets or Livestock

Fly larvae infesting an animal’s wound or skin (called myiasis) is a veterinary issue, not a DIY project. Flies lay eggs in open wounds, soiled fur, or skin folds, and the larvae feed on tissue. For livestock like sheep, the standard approach involves shearing the wool close to the skin around the affected area to physically remove the maggots, leaving a border of clean wool, and then applying a medicated flystrike dressing to prevent reinfestation. If you find maggots in a wound on a pet, clean the area with hydrogen peroxide or an antiseptic solution, physically remove visible larvae, and get the animal to a veterinarian. Secondary bacterial infections are common with myiasis, and animals that are lethargic or feverish need professional treatment.