How to get rid of fungus gnats in houseplants
Researched by Abu Bakar Saadat8 min read
Last updated: 15 November 2026References
IllustrationOn this page 10 sections
In short
Let the top of the compost dry out between waterings and clean up standing water, catch adults on yellow sticky traps, and treat the compost with Steinernema feltiae nematodes or a Bti product to kill the larvae. Keep going for 3 to 4 weeks.

At a glance
- What they are
- Small dark flies, 3 to 4 mm (RHS); larvae live in damp compost
- Main cause
- Compost that stays wet (RHS)
- Treat
- Drier compost, sticky traps, nematodes or Bti
- How long
- 3 to 4 weeks of changed watering may be needed (UW-Madison)
- Advice from
- UC IPM, RHS and University of Wisconsin-Madison Extension, read 28 October 2026
- Checked
- November 2026
Little black flies puffing up from the pot whenever you water can keep you away from your own plants. UW-Madison Extension notes that getting them under control may take three or four weeks of changed watering and a layer of sand or fine gravel on the compost.
UC IPM explains that fungus gnats spend most of their life as larvae and pupae in the compost, and the flies you see are the short-lived adults. The RHS says the larvae live in damp compost and numbers build up when it stays constantly wet, especially compost rich in organic matter. So the fix has two parts: make the compost a poor nursery, and kill the larvae already in it. UW-Madison Extension says sticky traps help, but changing the conditions in the pot is the single most important step, so if your habit is to hang a trap and hope for the best, I'm afraid the nursery downstairs is still open.
Why it takes a few weeks

Here's why this takes a little patience. UW-Madison says the stages overlap, with eggs, larvae, pupae and adults all present at once, so you need to keep going.
| Stage | Where | How long |
|---|---|---|
| Egg | Laid in the surface layer of moist compost (RHS) | About 3 days at 24 °C (UC IPM); 3 to 6 days (UW-Madison) |
| Larva | In the compost: whitish, see-through body, shiny black head (UC IPM), up to 6 mm (RHS) | About 10 days at 24 °C (UC IPM); 1 to 2 weeks (UW-Madison) |
| Pupa | In the compost | About 4 days at 24 °C (UC IPM) |
| Adult | Near pots and windows; weak fliers (UC IPM) | About a week (UW-Madison) |
| Whole cycle | About 17 days at 24 °C (UC IPM); 3 to 4 weeks (UW-Madison); about a month in summer (RHS) |
UC IPM gives its figures at 75 °F, and 24 °C is our conversion. UC IPM says warmer rooms speed things up.
How to get rid of them
Make sure they are fungus gnats.

Illustration: an adult, greatly enlarged Adults are dark, delicate flies that look like tiny mosquitoes, about 1.5 to 3 mm long (UC IPM) or 3 to 4 mm (RHS), with slender legs and antennae longer than the head (UC IPM). They hang around pots and compost and are drawn to windows (UC IPM). Shore flies look similar but have short, bristly antennae (UC IPM). Fungus gnats are often mistaken for fruit flies, but they are two distinct insects (UW-Madison).
You should see: small dark flies running over the compost or flying slowly around the plants.
Put potato chunks on the compost to find the larvae.

Illustration Place chunks of raw potato cut side down on the compost (UC IPM; not peel). After 3 to 4 days, lift them and look underneath (UW-Madison Extension). Throw them away and put down fresh ones if you're keeping watch (UC IPM). Do this on each pot to see which ones are breeding the flies. It is that easy, and a potato is a lot cheaper than guessing.
You should see: on an infested pot, tiny pale larvae with black heads on the underside of the potato or in the compost just beneath.
Let the top of the compost dry out between waterings.

Illustration: watering from below keeps the surface dry This is the step that matters most, so please don't skip it. Avoid overwatering and let the compost surface dry between waterings (UC IPM). UW-Madison Extension says to let the top 2.5 cm (1 in) dry before watering, or to water from below so the surface stays dry. Clean up any standing water (UC IPM). Drying the compost reduces numbers as long as the plant can cope with it (RHS).
You should see: a pale, dry top layer between waterings. Our guide to checking whether a plant needs water shows how to judge it.
Stand yellow sticky traps next to the pots.

Illustration Cut traps into small squares and fix them on sticks pushed into the compost (UC IPM), near the leaves (UW-Madison Extension). What it will do, it catches adults and helps you keep track of their numbers over time (UW-Madison). They help, but changing the conditions in the pot matters most (UW-Madison), and they can catch large numbers of other small creatures, including predators (RHS).
You should see: flies stuck to the card. Swap traps when they're covered, and compare the counts week by week.
Cover the compost with a layer of coarse sand or fine gravel.

Illustration A layer about 1.5 to 2.5 cm (1/2 to 1 in) deep keeps the surface drier and less attractive for egg laying (UW-Madison Extension). Keep it clear of the stems. It looks quite smart on top of a pot, too.
You should see: the compost fully hidden under a dry, even layer.
Careful: read the product label before use. Use only a product whose label covers your use, and follow its rate and interval.
Water nematodes or Bti into the compost to kill the larvae.

Illustration Don't worry, the word sounds much scarier than it is. Nematodes (Steinernema feltiae) are pathogenic nematodes (RHS) that control fungus gnat larvae (UC IPM). They work best in moist compost between about 16 and 32 °C (UC IPM, our conversion of 60 to 90 °F), keep searching for hosts, and are perishable, so use them as soon as they arrive (UC IPM). The RHS also lists predatory mites and a rove beetle as biological controls.
Bti kills only fly larvae, not eggs, pupae or adults (UC IPM, UW-Madison). It doesn't last indoors, so apply it several times, 5 to 7 days apart (UW-Madison; UC IPM says about every five days), and water it in well so it reaches the larvae (UW-Madison). Nematodes and Bti can be used together (UC IPM).
You should see: over the following weeks, fewer new flies on the traps and fewer larvae under the potato chunks.
If one pot is badly infested, repot it into new compost.

Illustration Sometimes a fresh start is the kindest thing for a badly infested pot. The RHS suggests repotting into newly bought compost and not reusing the old compost (it can go on a compost heap). Use a houseplant potting mix (RHS) and see our guide on how to repot a houseplant. Don't move infested plants next to clean ones (UC IPM).
You should see: the potato test on the repotted plant comes up clean.
Which treatment works on which stage
| Treatment | Works on | Source |
|---|---|---|
| Drier compost surface, sand or gravel layer | Fewer egg-laying sites; gnats thrive in moist conditions | UC IPM, UW-Madison, RHS |
| Yellow sticky traps | Adults only | UC IPM, UW-Madison |
| Bti | Larvae only | UC IPM, UW-Madison |
| Steinernema feltiae nematodes | Larvae | UC IPM, RHS |
| Predatory mites, rove beetle | Eggs, larvae and pupae | RHS |
| Repotting into new compost | Eggs and larvae in the old compost | RHS |
How to tell they're gone
- Chunks of potato come up with no larvae underneath (UC IPM).
- The sticky traps show adult numbers falling over time, as UW-Madison describes.
- You've kept going for 3 to 4 weeks, which UW-Madison says may be needed alongside drier watering and a sand or gravel layer.
- The compost surface dries between waterings.
Rules in the UK, Germany, the US and Pakistan
| UK | Germany | US | Pakistan | |
|---|---|---|---|---|
| Do you need a professional? | Changing the conditions in the pot is the single most important step (UW-Madison Extension) | |||
| If you buy a spray or bait | The label must show the HSE authorisation number and the uses it is authorised for (HSE) | Biocide labels name the BAuA registration number (N-...) and the approved uses (DLG guide published by LAVES Niedersachsen) | EPA registers all pesticides; read the label before buying and using one (EPA) | Every pesticide brand must be registered; selling an unregistered one is an offence (Agricultural Pesticides Ordinance 1971, s. 4) |
If they keep coming back
Remember that a few late flies don't mean you've failed, because the ones already in the compost still have to come out. Find what you're seeing below.
| What happens | What it means | What to do |
|---|---|---|
| Flies return after a week | New adults from larvae and pupae already in the compost | Keep the compost dry and repeat Bti every 5 to 7 days (UW-Madison) |
| Compost never dries on top | Too much water, or poor drainage | Water less, clean up standing water, improve drainage (UC IPM) |
| Flies appear after you open new compost | Eggs or larvae in stored mix | Use pasteurised mix; store it closed and off the ground (UC IPM) |
| Only one pot has larvae | That pot is the source | Treat or repot that one, and keep it apart (UC IPM, RHS) |
| Seedlings or cuttings wilting | Larvae can feed on young roots and stems (RHS) | Treat promptly; check the watering too (UC IPM) |
Questions readers ask
Do fungus gnats bite or harm people?
No. UC IPM says the adults don't bite people and don't damage plants. They are a nuisance, and the larvae in the compost are the stage that can harm roots.
Will fungus gnats kill my plant?
Rarely. The RHS says established plants are unlikely to be harmed; the larvae mostly eat dead roots, decaying plant matter and fungi. Seedlings, young plants and soft cuttings are at more risk (RHS, UC IPM). If a plant wilts, check the watering first: UC IPM says wilting is more often caused by water problems or root decay than by the larvae.
Are they the same as fruit flies?
No. UW-Madison Extension points out they are often mistaken for fruit flies, but they are two distinct insects; fungus gnats lay their eggs on moist potting soil. It also says vinegar traps don't work for monitoring fungus gnats; use yellow sticky traps or potato chunks instead.
Where did they come from?
Females lay eggs in moist potting compost and organic debris (UC IPM), so potting mix can become infested if it isn't pasteurised or is stored open. UC IPM suggests buying pasteurised potting mix and storing it off the ground in a closed container.
Sources and method
- Researched by
- Abu Bakar Saadat
- Tested by our team
- No. We have no record of anyone on our team trying these steps, so treat them as researched instructions from the sources below.
- Pictures
- 9 illustrations drawn for this article: drawings, not photos.
- Sources
- 7 named sources, linked below.
- What this page adds
- A life-cycle diagram with a stage-by-stage table, a 'which treatment works on which stage' table, and the potato-chunk test for larvae.
What to do next
Rescue a struggling houseplant Step 3 of 6
- How to get rid of aphids on houseplants without harsh spraysSticky leaves? Look for aphids.
- How to repot a houseplant, step by stepRoots poking out of the pot? Time for a bigger home.
- How to keep a houseplant alive in low light: pick the spot and check the lightA dark corner needs the right plant and a few tricks.
Did this solve the problem?
Where did you get stuck?
What did you think?
Reaction counts are loading.
Sources
We use primary, official and specialist sources appropriate to the topic.
- US EPA: Should I use a fogger? (updated 8 September 2026)
- HSE: Packaging and labelling requirements for biocidal products (updated 2 June 2026)
- LAVES Niedersachsen / DLG: Informationen, die einem Biozid-Produkt beigefügt sein müssen (German, PDF)
- Agricultural Pesticides Ordinance 1971, Pakistan (text, sections 1 and 4)
- UC IPM Pest Notes: Fungus gnats, UC ANR Publication 7448 (updated August 2013)
- RHS: Fungus gnats (sciarid flies) (no page date)
- University of Wisconsin-Madison Extension: Fungus gnats on houseplants, XHT1277 (revised 9 February 2021)


