How to Get Rid of Fungus Gnats in Soil, Step by Step
To get rid of fungus gnats, treat the soil, not the air. The larvae live in the top layer of moist potting mix, so the fixes that work are: let the surface of the soil dry out between waterings, trap the flying adults with yellow sticky cards, and treat the soil with a BTi product such as Mosquito Bits or Gnatrol to kill the larvae. Keep it up for several weeks, because new gnats keep hatching from eggs already in the pot.
Why fungus gnats are in your soil
Fungus gnats are small, dark flies, commonly 1/16 to 1/8 inch long, that look like tiny mosquitoes. According to the UC Statewide IPM Program, females lay eggs in moist potting soil and organic debris. The larvae, which have a shiny black head and a clear, legless body, feed on fungi, organic matter and fine root hairs.
Most of their life is spent in the soil as larvae and pupae, and UC IPM notes that the most effective controls target those stages rather than the short-lived adults. At 75°F, a new generation can be produced in about 17 days, so populations build quickly in warm homes.
Are they harmful? The adults do not bite people or damage plants; they are a nuisance. Large numbers of larvae can damage roots and stunt seedlings and young plants. UC IPM adds that a wilting houseplant is far more often caused by too much or too little water, root rot or poor drainage than by gnats.
Step 1: Let the top of the soil dry out
Damp soil is what keeps fungus gnats going. UC IPM advises avoiding overwatering, providing good drainage, and letting the surface of container soil dry between waterings.
- Water only when the top inch or two feels dry. A finger test works better than a schedule; our article on whether soil moisture meters are accurate explains why.
- Empty saucers and cachepots so pots never sit in water.
- Water from the bottom for a while if you can. The surface stays drier, where the gnats lay eggs.
Drying alone rarely clears a heavy infestation, but nothing else works for long without it.
Step 2: Trap the adults with yellow sticky cards
UC IPM recommends yellow sticky traps, cut into small squares and stuck on skewers in the pot. They catch the adults before they lay more eggs, and they show you whether the numbers are going down.
Sticky traps alone will not end the problem, because the larvae keep maturing in the soil. Use them as a monitor and a supporting control. Our guide to different types of insect traps compares sticky cards with other designs, and our Katchy indoor insect trap review covers a plug-in light trap for flying adults.
Step 3: Treat the larvae with BTi
BTi (Bacillus thuringiensis subspecies israelensis) is a naturally occurring bacterium that is toxic only to fly larvae such as mosquitoes and fungus gnats. UC IPM lists BTi products such as Mosquito Bits and Gnatrol as the most convenient option for home gardeners. They are sold at garden centers.
- Mix the product with water and use it as a soil drench, following the label.
- BTi does not persist indoors, so UC IPM says repeated applications at about five-day intervals may be needed.
- Use the right Bt. The Bt sold for caterpillars (subspecies kurstaki) does not work on fly larvae.
Beneficial nematodes (Steinernema feltiae) are a second option. They are mail-ordered, applied as a drench, and work best between 60°F and 90°F in moist soil, according to UC IPM.
Step 4: Check and trap larvae with potato slices
Raw potato is very attractive to fungus gnat larvae. UC IPM suggests pushing chunks of raw potato into the soil cut side down. After a few days, lift them, throw away any with larvae on them, and replace them. This shows you which pots are infested and pulls some larvae away from the roots.
Step 5: Clean up the source
- Remove decaying matter. Fallen leaves and rotting debris on the soil surface feed the larvae.
- Use fresh, pasteurized potting mix. UC IPM warns that incompletely composted organic matter in potting mix is often infested. Store bagged mix closed and off the ground.
- Improve drainage. Adding perlite or sand to the mix helps it dry faster.
- Go easy on organic fertilizers. Heavy manure or blood meal feeds the gnats as much as the plant.
- Isolate infested pots. Keep them away from clean plants so new adults do not spread. Severely infested plants can be repotted in fresh mix or discarded.
If you also see a white fuzzy layer on top of the soil, our guide on how to get rid of mold on plant soil covers that problem, which shares the same damp causes.
What about hydrogen peroxide?
A peroxide drench is often suggested online. An extension expert answering on Ask Extension said it may be effective, but recommended trying less severe controls first: cleaning out breeding places, fresh potting soil, clean pots and Bt. If you do use it, the suggested mix is one part 3% hydrogen peroxide to four parts water. Use it cautiously, because it is a strong oxidizer that kills many organisms. The same expert would not use it on seedlings.
What not to bother with
- Spraying the adults in the air. UC IPM advises against fogging or spraying gnats in flight. The adults are not the main problem.
- Insecticides as a first step. UC IPM says insecticides are rarely warranted for fungus gnats around the home. If an infestation is intolerable and BTi or nematodes are not available, a pyrethrin product labeled for houseplants gives temporary control; spray plants outdoors if you can.
Quick plan
| Week | What to do |
|---|---|
| Week 1 | Let the soil surface dry, empty saucers, set yellow sticky cards, start BTi drench |
| Weeks 2–3 | Repeat BTi at about five-day intervals, use potato slices to check for larvae, clean debris |
| Week 4 | Count gnats on the cards. If numbers keep falling, keep watering lightly. If not, repot in fresh pasteurized mix |
Frequently asked questions
Will gnats go away if soil dries out?
Drying the soil helps a lot, but often not completely on its own. Fungus gnat eggs and larvae need moist soil, so letting the surface dry between waterings breaks the cycle in the top layer where they live. Combine it with yellow sticky traps for adults and a BTi drench for larvae, and keep going for several weeks.
Does hydrogen peroxide kill fungus gnats in soil?
It may, but extension experts treat it as a last resort. An Ask Extension answer suggested one part 3% hydrogen peroxide to four parts water, used cautiously, since it kills many soil organisms. Try drying the soil, sticky traps, fresh potting mix and BTi first, and do not use peroxide on seedlings.
Should I throw away soil with gnats?
Not always. A light infestation can be cleared by drying the soil and using BTi. For a heavy infestation, repotting in fresh, pasteurized potting mix is often fastest. Bag the old soil, or solarize it in sealed plastic in a sunny spot for about 4 to 6 weeks, as UC IPM describes, before reusing it outdoors.
What kills fungus gnats but not plants?
BTi (Bacillus thuringiensis israelensis) kills fungus gnat larvae without harming plants, people or pets, because it targets only fly larvae. Beneficial Steinernema feltiae nematodes are another plant-safe option. Yellow sticky traps catch adults, and raw potato slices lure larvae out of the soil. None of these damage your plants.
Related reading
- How to get rid of mold on plant soil
- Different types of traps for insects
- Katchy indoor insect trap review
- How to water houseplants without overdoing it
- Are soil moisture meters accurate?
- Why are my pothos leaves turning yellow in water?
Sources
- UC Statewide IPM Program, Pest Notes: Fungus Gnats (Publication 7448).
- Ask Extension, Hydrogen Peroxide to control Fungus Gnats #737733, March 2021.




