How to Get Rid of Flies in Your Trash Can Fast

Flies show up in your trash can because it offers exactly what they need: moisture, warmth, and decaying organic matter. Getting rid of them means killing any maggots already inside, deep cleaning the bin, and then cutting off the conditions that drew flies in the first place. A female fly can lay up to 300 eggs at once, and those eggs hatch in about 24 hours, so acting fast matters.

Why Flies Target Your Trash Can

The flies buzzing around your garbage are typically house flies or blow flies. Blow flies are the metallic blue or green ones, and they’re especially drawn to meat scraps, pet waste, and rotting food. Both species go through the same life cycle: egg, larva (maggot), pupa, adult. From the moment eggs are laid, maggots emerge within a day, feed for roughly a week, then pupate and emerge as adult flies about eight days later. That means a single egg-laying event can produce a new swarm of flies in just over two weeks.

The key attractants are smell and moisture. Leaking trash bags, juice from meat packaging, fruit rinds, and any wet organic waste all send chemical signals that flies can detect from a distance. A closed lid helps, but if the inside of your bin is coated in old residue, flies will still find it.

Kill Maggots Already in the Bin

If you open the lid and see small, cream-colored worms wriggling around, those are maggots, and you need to deal with them before doing anything else. Several household methods work well.

Boiling water kills maggots on contact. Boil a full kettle or pot, then pour it slowly and directly over every visible maggot. The water doesn’t technically need to be boiling. Anything above 140°F is lethal, but boiling gives you a comfortable margin and costs nothing extra. Once the water cools, rinse the bin and bag up the dead maggots.

Vinegar solution works if you’d rather not handle boiling water outdoors. Mix one part white vinegar with three parts hot water, pour it into the trash can, close the lid, and let it sit for 30 minutes. The combination of acidity and heat kills the maggots. Drain the liquid, rinse, then wipe or spray the bin with the same vinegar solution again to disinfect.

Salt and sunlight is the simplest approach if you have time. Cover the maggots and surrounding surface with a thick layer of table salt, then leave the bin in direct sunlight for an hour or more. The heat and salt dehydrate the maggots. Rinse everything out afterward.

Freezing is an option for small indoor bins. Place the entire container in your freezer for a couple of hours, sealed so nothing escapes, then rinse and dispose of the dead maggots. In winter, leaving an outdoor bin outside in freezing temperatures accomplishes the same thing.

Deep Clean the Trash Can

Killing visible maggots solves the immediate problem, but fly eggs can hide in residue along the bottom and sides of the bin. A thorough scrub prevents the next generation from hatching. Do this on trash collection day or whenever the bin is empty.

Start by rinsing the empty can with a hose or in a utility sink. Then mix dish soap and white vinegar in a bucket of warm water and scrub the entire interior with a long-handled brush (an extendable tile scrubber works well). Don’t skip the underside of the lid, the rim, or any grooves where liquid pools. Scrub the outside too, since residue can collect around the base and handles.

Rinse everything thoroughly, tip the can on its side to drain, and leave the lid open overnight so the inside dries completely. Moisture left behind is an open invitation for the next round of eggs. York County’s waste management department specifically recommends vinegar over bleach for this job, since vinegar deodorizes without producing harsh fumes in an enclosed bin.

Control Moisture and Odor Between Cleanings

Flies locate your trash by smell, so reducing odor between deep cleans is one of the most effective long-term strategies. A few cheap household products can make a real difference.

Sprinkle a layer of baking soda across the bottom of the bin before dropping in a new bag. Baking soda neutralizes acidic odors from food waste. For extra protection, mix it with unscented cat litter. The litter absorbs any liquid that leaks through the bag, while the baking soda handles the smell. Charcoal briquettes (the plain kind, not lighter-fluid-soaked) also absorb odors effectively and can be tucked alongside the bag or placed under it.

Replace whichever absorbent you use every time you change the trash bag. If your bag tends to leak, double-bag meat scraps and wet waste in smaller bags before tossing them in. That one habit alone dramatically cuts the moisture and smell inside the bin.

Repel Flies With Essential Oils

Flies navigate toward food and breeding sites using scent, and strong herbal or citrus aromas can disrupt those signals. Peppermint, tea tree, lemongrass, and eucalyptus oils are the most commonly used options. Fill a spray bottle with water, add 10 to 15 drops of oil, shake well, and mist the inside of the lid and the rim of the bin after cleaning.

This isn’t a one-time fix. The scent fades within a few days, so you’ll need to reapply after each cleaning or at least once a week during warm months. Think of it as a supplemental layer on top of good sanitation rather than a standalone solution. A dirty bin sprayed with peppermint oil will still attract flies once the scent weakens.

Prevent Flies From Coming Back

Elimination and cleaning buy you a fresh start, but flies will return unless you change the conditions that attracted them. These habits keep your bin fly-free long term.

  • Keep the lid closed. This sounds obvious, but a lid left ajar for even a few hours gives flies enough time to land and lay eggs. If your bin’s lid doesn’t seal well, a bungee cord or weighted object can help.
  • Take trash out before it smells. In summer, meat scraps and dairy can start producing odor within a day. Don’t wait for the bag to fill up if it already stinks.
  • Bag everything. Loose items in the bin, especially food containers with residue, create direct contact between waste and the bin’s surfaces. Tying bags tightly before tossing them in makes a noticeable difference.
  • Rinse before recycling. If your recycling bin sits near your trash, rinsing cans and meat trays before tossing them keeps both bins from becoming fly magnets.
  • Store bins in shade when possible. Heat accelerates decomposition and intensifies odor. A bin sitting in full sun on a 90°F day will smell far worse, and attract far more flies, than one tucked under a carport or against a shaded wall.
  • Clean monthly in warm weather. Even with perfect bagging habits, small amounts of residue accumulate over time. A quick scrub with soapy water once a month during fly season keeps buildup from reaching the threshold that draws flies in.

Indoor Bins Need Attention Too

Kitchen trash cans are smaller and easier to clean but can still harbor fruit flies, drain flies, and house flies if food waste sits too long. The same principles apply on a smaller scale: use a bin with a tight-fitting lid, take food waste out daily in hot weather, and wipe the inside of the can with a vinegar-water mix every couple of weeks. Sprinkling baking soda under the bag absorbs odors and helps repel gnats and fruit flies between bag changes.

If you notice tiny flies hovering near the bin but not inside it, the source may be a nearby drain or piece of forgotten fruit rather than the trash itself. Flies often cluster around the most convenient food source, which isn’t always the one you suspect.