How to get rid of gnats outside
Clouds of tiny flies on a porch or over a flower bed are almost always coming from something damp within a few metres of where you are standing.
By Ryder M.Published Updated

Swat & Snap earns a commission from qualifying purchases made through the links on this page, at no extra cost to you. It does not change which products we pick — see how we pick and our affiliate disclosure.
First, work out which gnat you have
"Gnat" is not a species — it is what people call any small flying insect that is not obviously a fly or a mosquito. Outdoors, three different insects get the name, and the fix for each is different.
Fungus gnats. Dark, mosquito-shaped, about 3 mm, weak and drifting fliers. They hover low over soil, mulch and pots, and they rise in a cloud when you disturb the surface. The larvae live in the top few centimetres of wet organic matter. This is the one most people mean, and it is a moisture problem.
Non-biting midges. Slightly larger, often in dense mating swarms at head height near water at dusk. They breed in ponds, ditches and slow water, they do not bite, and they are almost impossible to control at source on a domestic property. The answer here is management rather than elimination.
Biting midges (no-see-ums). Very small, and you will know because they bite — a sharp sting disproportionate to the size, usually at dawn and dusk near damp sand, marsh or coastal mud. These need a repellent, not a trap.
If they are also indoors around your houseplants, the species is almost certainly fungus gnats, and fungus gnats in houseplants is the page you want. If they are in the kitchen around fruit or the bin, they are fruit flies, not gnats — gnats vs fruit flies vs drain flies separates all three in a table.
Find the damp thing
Fungus gnats need consistently wet organic matter. On a domestic property the source is nearly always one of these, and it is nearly always within a few metres of where you noticed them.
Walk the area and check, in rough order of how often each one turns out to be the answer:
- Pots and planters that are watered on a schedule rather than when they are dry. The top of the compost stays wet, which is exactly the habitat.
- Mulch piled too deep or heaped against a wall. Mulch should be a few centimetres and pulled back from the foundation. Deep, matted, permanently damp mulch is a gnat farm.
- A clogged gutter or downpipe. Wet leaf litter in a gutter is organic matter held permanently damp, often directly above the porch where you are seeing them.
- Saucers and trays under pots holding water between waterings.
- A compost heap that has gone anaerobic — soggy, flat and sour-smelling rather than warm and crumbly.
- A low spot in the lawn or a border that stays wet for days after rain or after the irrigation runs.
- Leaking outside tap, air-conditioning condensate line, or a slow hose connector.
- Grass clippings or leaves bagged and left against the side of the house.
- A bird bath, water butt, pond edge or rain barrel with debris in it.
- Under a deck, where it is shaded, the soil never dries and leaves accumulate.
Lift things. The source is often under something rather than in the open.
Dry it out — this is the actual fix
Everything else on this page is secondary to this section. Gnats are an indicator of standing moisture, and when the moisture goes they go.
- Water pots deeply and less often, letting the top 2-3 cm dry out between waterings. Water from below where you can. Dry surface soil breaks the breeding cycle outright.
- Empty every saucer and tray.
- Rake mulch out thin and pull it back 15-30 cm from walls and foundations. Replace matted old mulch rather than topping it up.
- Clear the gutters and check the downpipes run freely.
- Turn the compost and add dry brown material — cardboard, dry leaves, straw — until it is damp rather than wet.
- Fix the leak, whichever one it is.
- Improve drainage in the low spot, or stop irrigating it.
- Cut back dense ground cover that holds humidity against the soil.
Expect a visible reduction in about a week and the problem largely gone in two, because that is roughly one generation. Nothing you spray will beat that timeline, and most sprays will not match it.
Quick picks
| # | Product | Best for | Mechanism | Price |
|---|---|---|---|---|
| 1 | Our pickSafer Brand Houseplant Sticky StakesYellow sticky cards on a stake, pushed into the pot. They catch the adults while you fix the watering, which is the part that actually ends a gnat problem. | Gnats in potting soil | Yellow adhesive card | |
| 2 | Summit Mosquito BitsThe same BTI in granules. Releases faster than a dunk and doubles as the correct treatment for fungus gnats in houseplant soil. | Fast knockdown and fungus gnats | BTI granules | |
| 3 | RESCUE! Non-Toxic Disposable Fly TrapA hanging bag with a powerful bait. Effective, genuinely foul-smelling, and therefore a product you hang well away from the door you use. | Outdoor house flies | Water-activated attractant bag | |
| 4 | DynaTrap DT1775 Insect TrapUV light plus a titanium-dioxide CO2 surface and a fan. It is a trap, not a zapper, and that distinction is the whole reason it belongs on a mosquito page. | Yard-scale mosquito reduction | UV + TiO2 CO2 lure + suction fan |
#ad — every price link goes to Amazon and Swat & Snap earns a commission on qualifying purchases. No price is shown until it can be pulled live from the retailer.

Safer Brand Houseplant Sticky Stakes
Safer Brand · Gnats in potting soil
Yellow sticky cards on a stake, pushed into the pot. They catch the adults while you fix the watering, which is the part that actually ends a gnat problem.
- Also a diagnostic: a full card in three days tells you the soil is the source
- No chemistry near a plant you might eat from
- Adults only — larvae in the soil need drying out or a BTI product
- Visible yellow cards in a display pot
Check price on Amazon

Summit Mosquito Bits
Summit · Fast knockdown and fungus gnats
The same BTI in granules. Releases faster than a dunk and doubles as the correct treatment for fungus gnats in houseplant soil.
- Scatterable, so it treats a bog or a tray a dunk cannot sit in
- The one product that solves both a yard problem and a houseplant problem
- Shorter residual than a dunk — reapply more often
- Granules wash away in heavy rain
Check price on Amazon

RESCUE! Non-Toxic Disposable Fly Trap
RESCUE! · Outdoor house flies
A hanging bag with a powerful bait. Effective, genuinely foul-smelling, and therefore a product you hang well away from the door you use.
- Pulls flies away from a patio better than anything else at the price
- Nothing to plug in, nothing to refill
- The smell is the mechanism — hang it close and you have made things worse
- Full bags are unpleasant to take down
Check price on Amazon

DynaTrap DT1775 Insect Trap
DynaTrap · Yard-scale mosquito reduction
UV light plus a titanium-dioxide CO2 surface and a fan. It is a trap, not a zapper, and that distinction is the whole reason it belongs on a mosquito page.
- Lures with warmth and CO2, which is what mosquitoes actually track
- Silent apart from the fan — no snapping, no smell
- Takes weeks to dent a population, not one evening
- Runs continuously, so it is an ongoing power draw
Check price on Amazon
Treat what you cannot dry
Some water is not going anywhere: a pond, a water butt you want, a bog garden, a blocked natural low spot, a tree hole.
For those, use BTI — Bacillus thuringiensis israelensis, a naturally occurring soil bacterium that kills the larvae of fungus gnats, mosquitoes and black flies, and is harmless to fish, birds, pets and people. The EPA describes it as a larval control tool, and the granule format is the one to use outdoors because you can scatter it over soil and mulch as well as dropping it in water.
Practical notes:
- Granules release quickly and last one to two weeks, so reapply through the season and after heavy rain washes them away.
- Scatter over the surface of affected pots and beds, then water in lightly.
- Floating dunks are the format for a container of water you are leaving in place, and last around a month.
Mosquito dunks vs bits compares the two formats properly. It is written for mosquitoes, but it is the same product doing the same job on the same larvae.
Trap the adults that are already flying
Drying the source stops the next generation. It does not do anything about the cloud currently drifting across the patio, and that generation lives one to two weeks.
Yellow sticky stakes in the pots. Fungus gnats are strongly attracted to yellow, and a card pushed into the compost just above the surface catches the adults as they emerge. It is also the best diagnostic on this page: a card that fills in three days confirms the pot is a source, and a card that stays clean tells you to look somewhere else.
A hanging bait trap, for larger flies. If what is bothering you on the patio turns out to be house flies rather than gnats, a disposable attractant bag works well — but hang it at least 30 feet from the door you use, because the smell is the mechanism and hanging it close makes the situation worse rather than better.
A UV and fan trap. An outdoor trap that pulls insects in with light, warmth and a fan does catch gnats and midges along with everything else. Treat it as slow background pressure over weeks rather than a fix, and place it away from where you sit rather than next to it. Best mosquito traps covers the category, and DynaTrap vs Flowtron compares a trap against a zapper honestly.
What not to bother with
Foggers and hose-end sprays for gnats. A fog kills the adults in the air at the moment you spray and nothing else. The larvae in the soil are untouched, so a fresh generation emerges within days and you have achieved an afternoon. Pyrethroid yard concentrates are also toxic to bees and lethal to fish — never spray flowering plants or anywhere near a pond. Our general position on yard spraying is in natural mosquito control and pet-safe mosquito yard sprays.
Bug zappers. University of Florida research found zappers essentially useless for mosquito control, and the broader finding holds here too — the catch is overwhelmingly harmless non-target night-flying insects, and the gnats you care about are not phototactic enough to make up for it. Do bug zappers work.
Dish soap sprays on the soil. Will not reach larvae at depth, and repeated application damages roots.
Apple cider vinegar bowls outdoors. These work on fruit flies, which respond to fermentation odour. Fungus gnats largely ignore them, and outdoors the dish fills with rain and other insects. Indoors for fruit flies, it is a different story — fruit fly trap bait covers that.
Citronella candles, for anything. A small plume of smoke that any breeze disperses.
The two gnats you cannot really fix
Swarms of non-biting midges near water are seasonal and they come from the water body rather than from your property. You can reduce how much they bother you — keep outside lights off or switch to warm-toned bulbs, which attract far fewer insects, close windows at dusk, fit insect mesh, and sit upwind — but you cannot eliminate the source if the source is a lake.
Biting midges need a skin repellent rather than a trap, because the whole problem is that they come to you. A registered active on the CDC's list, applied before dusk, is the answer. Best yard mosquito repellents and best mosquito repellents for camping both cover the products that actually work on skin.
The order, one more time
- Identify which gnat it is.
- Find and dry the damp organic matter. This is the fix.
- BTI granules on the soil and in water you are keeping.
- Yellow sticky stakes to clear the adults already flying.
- Outside lights off or warm-toned, and mesh on the windows you open.
- A trap only as slow background pressure, placed away from where you sit.
Frequently asked
How do I get rid of gnats outside?
What causes gnats outside?
What kills gnat larvae in soil outdoors?
Do bug zappers or foggers get rid of gnats outside?
Why are there so many gnats on my porch?
More on fruit flies & gnats
Tiny flies in the kitchen are almost never one problem. Identify which of the three you have, then treat the source — the trap alone never finishes it.
Not sure yet? Read how we pick.
Ryder M.
Ryder M. is the hands-on owner behind Magoo Media Group. He writes Swat & Snap because he got tired of pest-control advice that was either a sales pitch or a scare story.
Related on Swat & Snap
- How to get rid of gnatsFungus gnats come off wet soil. The watering change, the BTI step, and a realistic timeline.

- Fungus gnats in houseplantsDry soil, grit top-dressing, BTI and sticky stakes — the four-part fix and the order to do it in.

- Gnats vs fruit flies vs drain fliesBehavior, not anatomy: the one-minute test that tells you which tiny fly you have.

- Mosquito dunks vs bitsSlow-release dunks or fast-release granules — which BTI format suits which water.

- The best yard mosquito repellentsRepellent zones and yard sprays that make a patio usable tonight — and what each trades away.

- How to get rid of house fliesWhere they breed outside, how they get in, and the traps that work on flies this size.

- Katchy vs DynaTrap (indoor)Glue board versus retaining cage: which indoor trap wins on gnats, fruit flies and house flies.
