Skip to content
HassleFix

Flies in the Kitchen Trash Can? Tight Lids and Habits That Stop Them

Flies lay eggs on food scraps and the maggots hatch within a day or two. Clean the can, bag the scraps, and use a lid that seals to keep them out.

By Jamilur Rahman Updated November 5, 2026 · 6 min read

Time
30 min
Cost
$20-$50
Difficulty
Easy
A kitchen trash can with its lid slightly open and a fly resting on the rim
In this guide
  1. Quick answer
  2. Free vs. permanent fix
  3. What you'll need
  4. Why it happens
  5. Try this first (free)
  6. When free fixes aren't enough
  7. Buy the fix
  8. House flies, fruit flies or drain flies? Match the fix
  9. What to skip
  10. FAQ
  11. Related problems

Quick answer

To prevent flies in a kitchen trash can, give them nothing to lay eggs on and no way in. Bag food scraps tightly, empty the can every two or three days (daily for meat and fish) and wash it with hot soapy water. A kitchen trash can with a tight-sealing lid keeps new flies out after the can is clean.

Free fix vs. permanent fix

Free fix · 20 minutes

Bag it, empty it, wash the can

  • Tie wet scraps in a small bag before they go in the can
  • Empty the can every two to three days
  • Wash it with hot soapy water and let it dry fully
  • Freeze meat and fish scraps until trash day

How long it lasts: As long as the habits stick. Flies find a gap in a loose lid within days if scraps sit out.

Most readers choose Permanent fix
Step-on kitchen trash can with a tight-sealing lid (illustration)
Illustration

A step-on can with a tight-sealing lid

Flies follow food smells and squeeze through gaps or wait for the lid to open. A step-on can with a lid that closes flush stays shut even when your hands are full. The cleaning removes what is in there now, and the lid keeps new flies out.

What to get: Step-on kitchen trash can with a tight-sealing lid

How long it lasts: Years. A lid that closes flush keeps flies away from the scraps between trash days.

As an Amazon Associate I earn from qualifying purchases.

What you'll need

  • Rubber gloves

    For emptying and scrubbing the can

    You have it
  • Dish soap and hot water

    Cuts the grease and slime that attract flies

    You have it
  • Small bowl, cider vinegar and dish soap

    A quick trap for fruit flies and gnats

    You have it
  • Freezer bag

    Holds meat and fish scraps until trash day

    Free
  • Our pick
    Step-on kitchen can with a tight-sealing lid (illustration)
    Illustration

    Step-on kitchen can with a tight-sealing lid

    Keeps flies out once the can is clean

  • Countertop food scrap bin with a locking lid (illustration)
    Illustration

    Countertop food scrap bin with a locking lid

    Holds the wettest scraps, the favorite of flies, in a sealed bin

Why it happens

1

Food scraps left uncovered

Flies smell rotting food from far away. Loose scraps on top of the bag give them a place to lay eggs.

2

Warm, wet trash

Heat and moisture speed everything up. Fly eggs can hatch into maggots in about a day in warm weather.

3

A loose, cracked or open lid

A lid that sits crooked or splits at the edge is an open door. An overfilled can that will not shut is worse.

4

Residue in the bottom of the can

Juice from a leaking bag collects under the liner. Eggs laid in that slime survive bag changes and hatch next week.

Try this first (free)

Do these in order, starting with the simplest.

  1. Empty and wash the can

    Tool used: Rubber gloves

    Wear gloves, scrub the can and the underside of the lid with hot soapy water, rinse, and let it dry in the air. Never mix bleach with vinegar or ammonia.

  2. Clear any maggots

    Tool used: Dish soap and hot water

    Tip them into a bag, tie it and put it in an outdoor bin. Rinse the empty can with very hot water, then scrub it with soap.

  3. Freeze the worst scraps

    Tool used: Freezer bag

    Put raw meat trimmings, fish and bones in a freezer bag in the freezer. Move them to the can on trash day.

  4. Keep the bottom dry

    Lay a few sheets of newspaper or paper towel under the liner to soak up leaks. Tie the bag at two-thirds full so the lid can close.

  5. Trap the stragglers

    Tool used: Small bowl, cider vinegar and dish soap

    Set a bowl with an inch of cider vinegar and a drop of dish soap near the can. Fruit flies and gnats drown in it. Replace it every few days.

  6. Switch to a can that shuts tight

    Tool used: Step-on kitchen can with a tight-sealing lid

    If flies are back within a week, the lid is the leak. Use a step-on can with a lid that closes flush.

    Step-on kitchen can with a tight-sealing lid (illustration)
    Illustration

    Tool for this step

    Step-on kitchen can with a tight-sealing lid · Keeps flies out once the can is clean

    Check price on Amazon

When free fixes aren't enough

If flies return within a week of a good clean, look at the lid. A lid that sits crooked, splits at the edge or leaves a gap at the hinge lets them in, and so does a can that is too full to shut. A can with a lid that closes flush on a steady pedal removes the way in. If you see flies in several rooms, or maggots in a spot away from the trash, the trash is not the source. Check drains and plant soil, and call pest control if you suspect something dead inside a wall.

Buy the fix

Still stuck after the free fixes? These are the products we would look at.

Our picks compared
PickProductFixesWho it's forBuy
Best pick
Step-on kitchen trash can with a tight-sealing lid (illustration)
Illustration
Step-on kitchen trash can with a tight-sealing lid
flies and maggots getting into the can between trash days Anyone who cooks often, has a warm kitchen, or keeps meat and fruit scraps in the can. Check price
Budget pick
Countertop food scrap bin with a locking lid (illustration)
Illustration
Countertop food scrap bin with a locking lid
wet scraps that feed flies sitting in the main can Someone who wants the cheapest sealed place for scraps while the main can gets cleaned. Check price
Best pick
Step-on kitchen trash can with a tight-sealing lid (illustration)
Illustration

Step-on kitchen trash can with a tight-sealing lid

Fixes: flies and maggots getting into the can between trash days

Look for: A lid that closes flush with no gap you can see; A solid pedal and a hinge that does not wobble, according to reviews; A removable inner bucket you can wash; A size that fits the bags you already buy.

Who it's for
Anyone who cooks often, has a warm kitchen, or keeps meat and fruit scraps in the can.
Honest downside
Your current can already seals well. Then the cleaning and scrap habits will do the job.
Budget pick
Countertop food scrap bin with a locking lid (illustration)
Illustration

Countertop food scrap bin with a locking lid

Fixes: wet scraps that feed flies sitting in the main can

Look for: A lid that clamps or locks shut; A body that is easy to rinse and dry; A size you will actually empty daily.

Who it's for
Someone who wants the cheapest sealed place for scraps while the main can gets cleaned.
Honest downside
You do not cook at home much, or you already freeze your scraps.

As an Amazon Associate I earn from qualifying purchases. We don't show prices because they change, so use the button to see today's price.

How we picked: How we picked: this page is based on pest-control and kitchen hygiene guides, product instructions from trash can makers, and what owners report in reviews. We do not test products by hand.

House flies, fruit flies or drain flies? Match the fix

  • House flies: larger, about a quarter inch. They lay eggs on meat, fish and garbage. Bag and freeze scraps and seal the lid.
  • Fruit flies and gnats: tiny, hover over ripe fruit and sweet spills. Use the vinegar trap and keep fruit in the fridge.
  • Drain flies: small, fuzzy and moth-like, near drains. They breed in drain slime, not in the can, so clean the drain.

What to skip

What to skip: sprays and chemical mixes

Spraying insecticide into a food-waste can only clears flies for a day, leaves residue near food and does nothing about the scraps. Never mix bleach with vinegar or ammonia, which makes toxic gas.

Frequently asked questions

What kind of kitchen trash can keeps flies out?
One with a lid that closes flush, a hinge that does not wobble and a pedal that closes it fully. Look for a removable bucket you can wash, since slime in the bottom of the can draws flies back.
How do I prevent maggots in a kitchen trash can?
Keep flies from reaching the food. Bag wet scraps, freeze meat and fish until trash day, keep the lid shut, and empty the can every two to three days.
Why does my garbage can keep getting maggots?
Eggs are probably surviving in leftover slime at the bottom, or flies are reaching the scraps through a loose lid. Scrub the can with hot soapy water, dry it, then check the lid.
How do I keep gnats out of a kitchen trash can?
Tiny gnats and fruit flies come from ripe fruit and sweet liquid. Bag the scraps, wipe the can rim, and set a bowl of cider vinegar with a drop of dish soap nearby.

As an Amazon Associate I earn from qualifying purchases. Affiliate disclosure

Step-on kitchen trash can with a tight-sealing lid (illustration)
Illustration

Our pick: Step-on kitchen trash can with a tight-sealing lid

Check price