How to get rid of maggots in a trash can
Boiling water kills them in seconds and needs nothing you do not already have. Read the safety note first, then work through the five steps in order.
By Ryder M. · Last reviewed September 27, 2026

Read this before you start
With that said: boiling water is the fastest and cheapest method, it works in seconds, it leaves no residue, and it needs nothing you do not already own. It is what we would do.
The five steps
Step 01
Take the can outside and remove the bag
Tie the bag tightly and put it straight into an outdoor can or, better, out for collection. Do not carry an open bag of maggots through the house — they fall, and they move faster than you expect. If the bag has split, double-bag it before you lift it.
Step 02
Pour boiling water over everything
Boil a full kettle, stand back, and pour it over the maggots and the inside of the can. They die on contact. Do the walls, the base, and particularly the bottom corners and any fold where they are clustering. Two or three kettles for a kitchen can, more for an outdoor cart. If the can is thin plastic, use very hot tap water and let it stand for five minutes instead.
Step 03
Check the rim, the lid and the ground
This is the step that decides whether they come back this week. Maggots crawl upward and outward to pupate, so check the underside of the rim, the inside of the lid, any gap in the lid hinge, and the ground around where the can was standing. Pour hot water over those too. A dozen maggots that made it out of the can become flies in a few days.
Step 04
Wash the can properly
Hot water and dish soap, then rinse and dry completely. This removes the residue that attracted the fly in the first place — killing the maggots without removing the food source means you will be doing this again. The full cleaning method.
Step 05
Dry it in direct sunlight if you can
Leave the can upside down in the sun. UV is a genuine disinfectant, drying removes the damp that eggs need, and it costs nothing. Give it a few hours before the next bag goes in.
Why they appeared overnight
Because they more or less did. A blowfly lays a few hundred eggs on exposed protein — a meat wrapper, a bone, a piece of fish — and in warm weather those eggs hatch in as little as eight to twenty-four hours. So a can that was fine yesterday genuinely can be crawling today, and it does not mean the can was filthy.
What it does mean is that a fly got access to exposed protein. There are only three ways that happens: the lid was open or propped, the lid does not seal, or the waste went into an outdoor can where flies have constant access. The white larvae people sometimes describe as “worms” in a trash can are the same thing — blowfly or housefly larvae — rather than a separate problem.
| Condition | Effect on the timeline |
|---|---|
| Warm weather (above ~25C / 77F) | Eggs hatch in under a day |
| Cool weather | Can take two to three days, or not at all |
| Exposed meat, fish or dairy | The trigger — flies target protein |
| A lid that does not seal | Gives the fly access at all |
| An outdoor can in summer | The highest-risk case by far |
Stopping it happening again
Five things, in order of how much difference they make.
- Wrap meat, fish and bones before they go in the can, or better, keep them in the freezer until collection day. Frozen waste cannot be laid on and does not decompose. This is the single most effective change and it is free.
- Keep the lid closed and check that it seals. A lid propped open by an overhanging bag is an open invitation, and an overhanging bag is extremely common. Why bags overhang and how to fix it.
- Empty the can before it is full, in hot weather especially. Frequency beats capacity every time in summer.
- Keep the outdoor can in shade. An outdoor cart in direct afternoon sun runs far hotter inside than the air temperature, and heat is what compresses the egg-to-maggot timeline.
- Rinse the outdoor can after anything meat-based. Residue at the bottom of a cart is what attracts the next fly. Outdoor cans that seal properly.
Two things worth having if this is a recurring outdoor problem: a baking soda powder to knock back the residue smell that attracts flies, and a cart with an attached hinged lid that actually closes on the rim.

Best for outdoor cans
Arm & Hammer Trash Can & Dumpster Deodorizer, 42.6 oz
Baking soda in a sprinkle-top jar, sized for the outdoor can where a lid pod would be pointless.

Best outdoor cart overall
Toter Heavy Duty Two-Wheel Trash Cart, 64 Gallon
The cart most municipalities issue, sold retail: rotationally molded, ten-year warranty, and a lid hinged to the body.
Common questions
What kills maggots in a trash can instantly?
Boiling water, poured directly over them. They die on contact. Take the can outside first, stand back while pouring, and use very hot tap water instead if the can is thin plastic you care about.
Why does my trash can have maggots?
A blowfly laid eggs on exposed protein — a meat wrapper, a bone, some fish — and in warm weather those eggs hatch in under a day. It means a fly got access, not that the can was dirty.
How do you clean a trash can after maggots?
Kill them with boiling water first, check the rim, lid and surrounding ground for escapees, then wash with hot water and dish soap to remove the residue that attracted the fly. Dry it in sunlight before using it again.
What are the little white worms in my trash can?
Blowfly or housefly larvae — maggots. There is no separate pest that looks like that in a domestic trash can, so treat them the same way.
How do I stop maggots coming back?
Freeze or wrap meat, fish and bones rather than binning them loose; keep the lid sealed; empty more often in hot weather; and keep the outdoor can in shade. The freezer habit alone prevents most recurrences.
Can maggots get out of a closed trash can?
Yes — they crawl upward to pupate and will find a lid seam or a hinge gap. That is why checking the rim, the lid and the ground around the can matters as much as treating the inside.
Read next
- Odor ControlThe free fixes first, then filters, deodorizers and cans built to contain smell.
- How to clean a trash canThe full method, including the underside of the rim everyone misses.
- Trash can fruit fliesFind the breeding site first, then trap. The order is the whole fix.
- The best outdoor trash cansSix outdoor cans on construction, lid design and what your hauler will lift.
- How to stop trash can smellSeven steps in order, free ones first, plus the three places residue hides.
- Why your trash bag doesn't fitThe mechanism behind the overhang, and five fixes ordered by cost.
The author
Ryder M.
Owner and editor of Lid & Liner, published by Magoo Media Group. He started the site after getting tired of the same problem everyone has: every “best trash can” article covers ten products and none of them tells you whether a 13-gallon bag actually fits a 13-gallon can. Lid & Liner covers one category and tries to cover it completely.
Last reviewed September 27, 2026. Spotted an error? Tell us and we will correct it and note the correction.