How to Get Rid of Fungus Gnats in Houseplants (Step by Step)
Tiny black flies around your plants? They’re almost certainly fungus gnats. Here’s a simple plan to break their life cycle and keep them from coming back.
In this guide
Quick answer
Fungus gnats breed in damp potting mix. To get rid of them: let the top 1–2 inches of soil dry out between waterings, catch adults with yellow sticky traps, and treat the soil with a product containing Bti (Bacillus thuringiensis subsp. israelensis) to kill the larvae. Keep it up for three to four weeks to break the life cycle.
Fungus gnats are annoying but usually harmless to healthy plants. The adults are small, dark, mosquito-like flies that wander over the soil and flutter up when you water. The real issue is their larvae, which live in the top layer of damp soil.
How to tell if you have fungus gnats
- Tiny dark flies (a few millimetres long) with long legs, flying weakly around plants or windows.
- Flies that rise from the soil when you disturb or water it.
- Tiny, clear-to-white worm-like larvae with a black head in the top inch of soil.
- Soil that stays damp for a long time.
Not sure? Fruit flies are rounder, often have red eyes and hang around fruit and drains rather than plant soil. Whiteflies are white and flutter up from the underside of leaves.
Why fungus gnats show up
Fungus gnat larvae feed on fungi and decaying material in moist potting mix. Overwatered plants, peat-heavy mixes that stay wet, pots without drainage and bags of potting mix stored damp are all ideal nurseries. New plants from the store can also bring them home.
The fungus gnat life cycle (why patience matters)
Adults lay eggs in damp soil. The eggs hatch into larvae that feed in the soil, then turn into pupae, then emerge as new adults. In a warm home, a full cycle can take only a few weeks — so killing adults alone won’t solve the problem. You need to deal with the soil, too, and keep going long enough to catch every generation.
Step-by-step: how to get rid of fungus gnats
- Let the soil dry out. Water only when the top 1–2 inches are dry. Larvae need moist soil to survive, so this is the most important step. Empty saucers after watering.
- Put up yellow sticky traps. Stick them into the soil or hang them just above pots. They catch adults before they lay more eggs and show you whether numbers are falling.
- Treat the soil with Bti. Bti is a naturally occurring bacterium that targets fly larvae and is widely sold for fungus gnats and mosquitoes (as granules, liquid or “dunks”). Follow the product label — usually you water it into the soil and repeat every week or so for several weeks.
- Remove the top layer if it’s heavily infested. Scoop out the top inch of soil, bag it and replace it with fresh, dry potting mix.
- Consider bottom watering. Setting pots in a tray of water lets roots drink while the soil surface stays drier.
- Keep going for 3–4 weeks. Even when you stop seeing flies, continue a little longer to catch late hatchers.
What about other treatments?
- Beneficial nematodes (Steinernema feltiae) sold for fungus gnats attack larvae in the soil and are a good option for heavy or recurring problems.
- A top layer of coarse sand or grit can make the surface less inviting for egg-laying, but it also makes it harder to see when soil is dry.
- Hydrogen peroxide soil drenches are popular online, but results vary and strong solutions can harm roots. If you try it, use a weak dilution and test on one plant first.
- Insecticide sprays generally aren’t needed for fungus gnats in the home and don’t reach larvae in the soil.
How to prevent fungus gnats
- Water based on soil moisture, not a schedule — see how often to water houseplants.
- Use pots with drainage holes and an airy mix with perlite or bark — see potting mix basics.
- Don’t choose pots that are far too big for the root ball.
- Store opened bags of potting mix sealed and dry.
- Check new plants and keep them apart from your collection for a couple of weeks.
- Remove fallen leaves from the soil surface.
Do fungus gnats damage plants?
Usually not much. Large numbers of larvae can nibble fine roots, which matters most for seedlings, cuttings and young plants. On established houseplants, fungus gnats are mainly a nuisance and a sign the soil is staying too wet. If your plant is also yellowing and wilting, check for root rot.
Frequently asked questions
Can I use a vinegar trap for fungus gnats?
Vinegar or wine traps are designed for fruit flies. Fungus gnats aren’t strongly attracted to them, so yellow sticky traps work much better.
Should I repot to get rid of fungus gnats?
It isn’t usually necessary. Drying the soil and treating with Bti works for most infestations. Repot if the soil is waterlogged, smells sour or the plant is also showing signs of root rot.
Are fungus gnats harmful to people or pets?
No. They don’t bite or spread disease to people or pets. They’re simply annoying.
Sources and further reading
- UC Statewide IPM Program — Pest Notes: Fungus Gnats
- UC Statewide IPM Program — Houseplant Problems


