Keep Flies Out of a Trash Can

Stopping flies and maggots from breeding in an outdoor trash can — drying out the moisture they need, or masking the scent that draws them in.

2 takes from different creators

Keep Flies Out of an Outdoor Trash Can With a Toilet Deodorizer Cake

Drop a hanging toilet rim deodorizer cake into the bottom of an outdoor trash can. The same strong scent that's meant to mask bathroom odor keeps flies from landing and laying eggs in the bag for days at a stretch.

trash can smells in summer, flies swarming garbage bin, maggots in outdoor trash can, keep flies out of garbage, outdoor bin fly control

beginner Added Aug 16, 2026

The Problem

An outdoor trash can left closed in warm weather is enough time for flies to find the seam, lay eggs in the food scraps, and hatch maggots — often within days. Emptying and scrubbing the can deals with an infestation after the fact, but does nothing to stop the next one from starting the moment the lid closes again.

The Technique

  1. Buy a standard hanging toilet rim deodorizer cake — the kind sold at any dollar store for keeping a toilet bowl smelling clean.
  2. Drop it into the bottom of the trash can, under or beside the liner bag, or hang it from the cake's built-in clip against the inside wall above the bag.
  3. Leave it in place. One cake kept flies and maggots out of a bin of regular household and food-scrap trash for at least four days of testing before it needed checking again.
  4. Replace it once the scent has faded — that's the point at which it stops working.
Safety note: Toilet deodorizer cakes are made to be handled with bare hands but not eaten or chewed — keep them away from pets and small children who might get into an open trash can, and don't let one sit where runoff could wash into a garden bed or storm drain.

Keep a Summer Trash Can From Breeding Maggots With a Layer of Salt

Clean the can out, then pour salt in the bottom. Salt absorbs the moisture that maggots and flies need, which matters most when the can will sit closed in the heat — like the week you're out of town.

trash can smells in summer, maggots in garbage can, flies in outdoor bin, deodorize garbage can

beginner Added Aug 8, 2026

The Problem

A closed trash can in summer heat is a fly incubator: moisture from food waste condenses inside, eggs hatch in days, and a week of vacation is enough to come home to maggots and a smell you'll hunt through the whole yard before finding.

The Technique

  1. Empty the can and clean it out.
  2. Pour a layer of salt across the bottom.
  3. Repeat when the salt gets saturated or discarded with a bag.

The salt absorbs the moisture that both the smell and the maggots depend on. It's cheapest insurance right before leaving town in hot weather, when the can will sit sealed and cooking for days.

DIYsolvr helps you find the best DIY videos. Browse all 526 techniques