How to Get Rid of Fungus Gnats in Potted Plants (2026)
Heads up: this article contains affiliate links. If you buy through them, we may earn a small commission at no extra cost to you. Read our full disclosure.
If tiny black flies rise up every time you water your pots, and they hover around your seedlings like a little dark cloud, you have fungus gnats — and they're telling you something important about your watering. Fungus gnats aren't dangerous to people, and they barely damage mature plants, but their larvae live in the top layer of damp soil and chew on seedling roots, which can kill young plants outright. The good news: fungus gnats are a symptom, not a disaster. They mean the top of your soil is staying wet too long, and fixing the watering fixes the gnats. This guide is the three-week plan that breaks their life cycle for good.
First, the reassurance: fungus gnats are the most common indoor and balcony pest in the world, and every gardener gets them at some point. They don't mean you're a bad gardener — they mean your soil is staying damp, which is an easy habit to fix. The adult flies you see are just the tip of the problem; the larvae in the soil are the part that matters, and they're the part most treatments miss.
Step 1: Dry Out the Top Soil (The Main Fix)
Fungus gnat larvae need moist soil to survive. If you let the top 1–2 inches of soil dry out completely before watering again, you kill a large portion of the larvae within days, and you make the soil unattractive to egg-laying females. This is the single most important step, and it's free.
Change your watering habit: stop watering on a schedule and start watering by touch. Push your finger an inch into the soil — if it feels damp, don't water yet. If it feels dry, water. For most balcony vegetables, that means watering every two to three days instead of every day, and watering deeply when you do water, rather than sprinkling a little every morning. Bottom watering helps, too: stand the pot in a shallow tray of water for 10–15 minutes so the roots drink from below while the top layer stays dry — right where the gnats live. If you're not sure how wet your soil should be, see the signs of overwatering plants in pots — overwatering is the root cause of most gnat problems.
Step 2: Trap the Adults (Yellow Sticky Cards)
While the soil dries out, trap the adults so they can't lay more eggs. Yellow sticky traps — small yellow cards on a stick that you push into the soil — are cheap (a pack costs a few dollars) and very effective, because fungus gnats are attracted to the color yellow and get stuck on the glue. Place one trap per pot, just above the soil surface, and replace it when it's covered in gnats.
Sticky traps won't solve the problem alone — they only catch the adults, not the larvae in the soil — but they're an excellent indicator. If the trap fills up in a day, you have a big infestation. If it catches one or two gnats a week, the problem is nearly over. Keep a trap in each pot for a few weeks after the gnats seem gone, as an early-warning system: the moment you see gnats on the card, you know to let the soil dry out again before the population rebuilds.
Step 3: Kill the Larvae (The 3-Week Treatment)
Drying the soil and trapping the adults handles most of the problem, but for a stubborn infestation, you need to kill the larvae directly. Three treatments work well, and you can pick whichever you can find at the hardware store:
- Mosquito Bits tea (BTi): soak a tablespoon of Mosquito Bits in a gallon of water for 30 minutes, strain, and water your plants with it. The active ingredient, Bacillus thuringiensis israelensis (BTi), is a naturally occurring bacterium that kills gnat larvae but is harmless to plants, pets, and people. Apply every 7–10 days for three weeks. This is the most targeted and safest option.
- Hydrogen peroxide drench: mix 1 part ordinary 3% hydrogen peroxide with 4 parts water and water the soil thoroughly. Repeat weekly for three weeks. It kills larvae on contact and then breaks down into water and oxygen, so it doesn't leave residue. Don't use a stronger concentration — 3% from the drugstore is the right strength.
- Neem oil drench: mix neem oil per the label directions with a drop of dish soap, and water it into the soil every 7–10 days for three weeks. Neem disrupts the larvae's development and also helps with other soil pests.
Whichever you choose, treat all nearby plants at the same time. Gnats spread between pots easily, and treating one plant while leaving its neighbor alone just restarts the cycle within days. And keep treating for at least three weeks — that's how long it takes to break the full life cycle, from egg to larva to adult. Stopping after one week is the most common reason gnat treatments “don't work.” Our guide to how to get rid of spider mites on balcony plants uses the same cycle-breaking logic for a different pest.
Step 4: Prevent Them Coming Back
Once the gnats are gone, keep them gone with three habits. First, keep watering by touch, not by schedule — the top inch dry before you water again. Second, top-dress your pots with a thin layer of sand, fine gravel, or horticultural grit. Gnats lay their eggs in moist organic soil, and they won't lay eggs in a layer of dry, inert sand. A quarter-inch layer is enough, and it also makes your pots look tidy.
Third, check new plants and new bags of potting mix before you bring them home. Gnats often arrive in a bag of potting mix that's been stored damp, or on a nursery plant with wet soil. If a new bag smells musty or the soil inside is soggy, let it dry out in the sun before you use it. And if you bring home a new plant, quarantine it away from your other pots for a week and watch for gnats before you put it on the balcony. For the soil side of prevention, see the best seed starting mix for beginners — fresh, free-draining mix is your first line of defense.
When Gnats Mean Something Else Is Wrong
If you keep getting fungus gnats no matter what you do, look at the pot, not the pest. A pot with no drainage holes will always have wet soil at the bottom, no matter how carefully you water. A saucer that always has standing water in it is a gnat nursery. And a pot of dense, compacted soil that never dries out is a permanent gnat habitat. Fix the drainage — drill holes, empty the saucer after watering, refresh the soil with perlite — and the gnats will leave on their own. The gnats are a symptom; the pot is the cause.