How to Get Rid of Flies and Gnats Around Your Trash Can
Quick Answer: Flies and gnats gather at a trash can because the bottom holds a wet film of food residue they can breed in. Sprays and traps only thin out the adults. What stops them is removing that residue: wash the can with soap and water, let it dry, keep the lid shut, bag and tie wet waste, and rinse recycling before it goes in.
TLDR:
- Flies and gnats are after the moisture and residue in the can, not the bagged trash.
- Name the bug first. Fruit flies, drain flies and phorid flies all breed in different spots.
- A leaky liner that leaves a wet bottom is a textbook fruit fly breeding site.
- Sprays, fogs and bait traps give temporary relief. They do not end an infestation.
- A clean, dry can with a tight lid takes away the breeding site itself.
- Unrinsed soda and beer cans make a recycling bin a gnat nursery.
- Gnats around houseplants are usually fungus gnats, not a trash problem.
If you live in Huntsville, Madison, Athens or Harvest, you know the scene. You lift the lid in July and a little cloud comes up to meet you. The garage door opens, and a few follow you inside.
The heat is a big part of it. Texas A&M AgriLife Extension’s 2016 fact sheet on indoor flies says a house fly takes about 45 days to finish its life cycle at 60°F, but only 7 days at 95°F. A North Alabama summer keeps that clock running fast.
Tired of the cloud that greets you at the lid? TidyCan cleans your trash can curbside with 200°F water and no harsh chemicals, on the same day as your trash pickup.
First, Figure Out Which Bug You Have
“Gnat” is a catch-all word for any small fly, and that is where a lot of wasted effort starts. Each type breeds somewhere slightly different, so the fix depends on which one you are looking at.
The Texas A&M fact sheet puts it plainly: because each indoor fly prefers slightly different breeding sites, identifying the fly should be the first step. The table below sums up the common ones around a home and its bins, all drawn from that same Texas A&M AgriLife guide.
| Bug | What it looks like | Where it breeds near a bin |
|---|---|---|
| House fly | Larger fly that does not bite | Garbage and other decaying organic matter |
| Blow fly | Shiny blue or green | Garbage, rotting meat, dead animals |
| Fruit fly | About 1/8 inch, usually reddish eyes | Wet can bottoms, fermenting scraps, unrinsed recycling |
| Drain fly | Fuzzy, gray, moth-like | Thin slimy films, including the bottoms of garbage cans |
| Phorid fly | Fruit fly size, humpbacked, runs before it flies | Moist decaying matter, including garbage cans |
| Fungus gnat | Tiny, mosquito-like, long legs | Damp potting soil, not usually the trash |
If the swarm hovers at the lid and the bottom of the can, you are almost always dealing with one of the first five. If the gnats are drifting around your houseplants instead, the trash can is probably innocent.
What Draws Flies and Gnats to a Bin
Bagged trash is not really the attraction. The real draw is everything that escapes the bag and sits in the bottom of the cart.
The Texas A&M guide says moisture is critical for fly breeding and that larvae cannot develop without some source of water. On its list of common fruit fly breeding sites, the first entry is the wet bottom of a trash can where a plastic liner has leaked.
The University of Kentucky’s fruit fly fact sheet, revised in 2026, makes the same point from a different angle. It says fruit flies breed in trash containers and empty bottles and cans, and that “all that is needed for development is a moist film of fermenting material.” It also notes a female can lay about 500 eggs.
That is why a can that looks empty can still have flies. A thin sticky layer you barely notice is a full meal and a nursery to them, and it builds up a little more every week. Our guide to what is really behind a trash can smell explains how that same residue drives the odor.
What Actually Stops Them
Every source we checked lands in the same place. You stop flies and gnats by taking away where they breed, then mopping up the stragglers. Here is the order that works.
1. Clean out the residue. Pull the bag and check under the liner. The Texas A&M guide says to use soap and water to remove all organic residue there if needed. Scrub the bottom and the rim, rinse, and drain.
2. Let it dry completely. Tip the can on its side in the sun with the lid open. No water means no place for larvae to develop.
Before
After3. Keep a tight lid on it. Virginia Cooperative Extension’s house fly fact sheet, revised in 2021, calls sanitation “extremely important” and recommends garbage bags plus a can with a tight-sealing lid. A lid propped open by an overstuffed bag lets flies walk right in.
4. Bag, tie and double up on wet waste. Leaks are what create the wet bottom in the first place. Meat trays, fruit scraps and anything drippy should go in a tied bag, and a second bag if it is soggy.
5. Rinse recycling before it goes out. The Texas A&M list of fruit fly breeding sites includes recycling bins with unrinsed wine, beer or soda containers. A quick rinse removes the sugar film they want.
6. Then deal with the adults. Once the source is gone, a fly swatter or a trap handles the leftovers. The Kentucky fact sheet recommends a simple jar trap with a paper funnel and a few ounces of cider vinegar.
Want the residue gone without the scrubbing? Our Monthly plan cleans and deodorizes up to two bins every 4 weeks with 200°F water, from $30.
What Does Not Work on Its Own
Most of the quick fixes people reach for go after the flies you can see. None of them touch the film in the bottom of the can, so the problem comes right back.
Sprays and fogs. The Texas A&M guide says insecticides alone are rarely successful in eliminating indoor fly infestations. The Kentucky fact sheet goes further: unless the breeding sites are removed or cleaned, the problem will continue “no matter how often insecticides are applied.”
Bait traps by themselves. Texas A&M says bait traps alone rarely provide adequate fly control. They are still useful for showing where the flies are coming from, or for thinning them out while you clean.
Outdoor bug lights near the bin. The Virginia Tech fact sheet notes that light traps may be useful outdoors, but they can also draw flies in from a broader area. Parking one next to your cart can pull in more flies than it removes.
A quick hose rinse. Water alone moves the residue around more than it removes it, and a can left wet afterward is exactly what the larvae need. Soap, scrubbing and drying are what make the difference.
Gnats in the Kitchen Can vs. Flies at the Curb
The indoor trash can and the outdoor cart usually have different bugs. Sorting out which one you are fighting saves a lot of time.
Tiny flies in the kitchen are most often fruit flies. Texas A&M notes they are small enough to pass through window screens, and their life cycle can finish in as few as 8 days. Check the kitchen can’s liner, the recycling bin, and any produce sitting on the counter.
Gnats that will not leave the sink area may be drain flies breeding in the pipe, not the trash. Texas A&M suggests laying clear tape across the drain without fully covering it, then checking it for stuck flies. The same guide says bleach or drain cleaner is largely ineffective on that film; the pipe needs a stiff brush.
Bigger flies at the curb tend to be house flies or blow flies working the outdoor cart. If you find maggots, our step-by-step guide to getting rid of maggots in a trash can covers that cleanup.
How TidyCan Takes Away the Breeding Ground
Everything above comes down to one job: keeping the inside of the cart clean and dry, so there is nothing to breed in. That is the part most people find hardest to keep up with in an Alabama summer.
TidyCan cleans the inside and outside of your cans at the curb with high-pressure, 200°F water, then sanitizes and deodorizes them. There are no harsh chemicals, and it happens on the same day as your trash pickup, so the can is empty when we get there. Up to two bins are included on every plan.
The sticky film in a blue bin draws gnats too, so we offer recycling bin cleaning as well. You can compare every cleaning plan and price before you sign up, starting at $30 every 4 weeks.
What North Alabama Homeowners Ask About Flies and Gnats at the Bin
These questions come up most once the weather warms up across North Alabama. If yours is not here, call or text (256) 320-8042 and ask.
Why are there so many flies around my trash can even though I bag everything?
Bags leak and scraps miss the bag, leaving a wet film on the bottom of the can. That film is what flies and gnats breed in. Check under the liner, wash the bottom with soap and water, let the can dry completely, and keep the lid fully closed between pickups.
What are the tiny gnats in my trash can?
They are usually fruit flies, which are about an eighth of an inch long and often have red eyes. Drain flies, which look fuzzy and moth-like, and humpbacked phorid flies can also breed in the bottom of a garbage can. Fungus gnats usually come from damp houseplant soil instead.
Do fly traps work around a trash can?
Traps catch adults, but on their own they rarely solve the problem because new flies keep emerging from the residue. Use a trap to thin out the adults while you clean the can. Avoid outdoor bug lights right next to the bin, since they can attract flies from farther away.
Will spraying bug spray in my trash can stop the flies?
Not for long. Sprays kill the adults you hit, but the eggs and larvae in the wet residue keep coming. Extension entomologists say the infestation continues until the breeding site is cleaned. Remove the residue first, then a spray or swatter can handle any stragglers.
How do I keep gnats out of my recycling bin?
Rinse cans and bottles before they go in, especially soda, beer and wine containers, since the sugary film is what fruit flies breed in. Keep the lid closed and clean the bin itself every so often, because sticky residue builds up on the bottom over time.
How often should I clean my trash can to prevent flies?
There is no single number that fits every household, but flies need only a thin wet film to breed. During the hot months, cleaning every few weeks keeps that film from building up. Many North Alabama homeowners choose a cleaning every 4 weeks in summer.
Hand off the part the flies care about. We clean and sanitize your bins at the curb on pickup day, so there is no residue left for flies and gnats to breed in. Service is contactless, so you do not need to be home, and every plan price is published up front.