Quick Answer: Let the top 2 inches of soil dry completely between waterings — this alone stops most infestations. For active infestations, use yellow sticky traps for adults and a BTi (Mosquito Bits) soil drench to kill larvae. Repeat weekly for 4 weeks to break all life cycle stages.
Yellow sticky trap placed in plant pot catching fungus gnats hovering over soil

How to Get Rid of Gnats in Plant Soil: 7 Methods That Work

Are They Fungus Gnats or Fruit Flies

Before treating, confirm what you're dealing with. The two most common small flies found indoors — fungus gnats and fruit flies — look similar at first glance but have completely different biology and breeding sites, which means different treatment approaches.

Fungus Gnats (Family Sciaridae)

Fungus gnats are dark grey to black, about 2–3mm long, with long thin legs, long antennae, and prominent wings held flat along their bodies at rest. They are specifically associated with moist potting soil and are most visible hovering directly above or crawling across the soil surface. When they land, they walk quickly in a jerky, erratic pattern. If the flies are consistently around your plant pots and the soil has been kept consistently moist, fungus gnats are almost certainly the culprit.

Fruit Flies (Drosophilidae)

Fruit flies are smaller, tan or orange-brown, with distinctively large red eyes visible under magnification. They are attracted to fermenting organic material — overripe fruit, compost bins, vinegar, beer, wine. Fruit flies typically cluster near kitchen bins, fruit bowls, and compost rather than plant pots specifically. A simple test: place a small glass of apple cider vinegar with a drop of dish soap near the flies. Fruit flies are strongly attracted to vinegar; fungus gnats generally are not.

This guide addresses fungus gnats. For the broader context of all common houseplant pests, see our houseplant pests guide.

Why Your Plants Keep Getting Gnats

Fungus gnats breed almost exclusively in moist, organically rich growing media. Understanding why they keep returning is the key to permanent control.

The Root Cause: Overwatered Soil

Fungus gnat larvae require two things to survive: moisture and organic matter. Consistently moist soil — the top 2 inches staying damp for more than a day or two — provides the perfect environment. The organic matter in most commercial potting mixes (peat, coir, composted bark) serves as food. Female gnats lay eggs specifically in moist organic soils, and a single female can lay 100–200 eggs in her two-week lifespan.

Why They Keep Coming Back

The most common reason fungus gnat infestations recur is that treatment addresses only the adult flies without eliminating larvae in the soil. Sticky traps catch adults, but for every adult you catch, there may be hundreds of larvae developing below the soil surface. Adults emerge continuously over several weeks from larvae laid before treatment began — so even if your traps show fewer catches, larvae are still present.

The Lifecycle Overlap Problem

The fungus gnat lifecycle runs approximately 21–28 days at room temperature: eggs hatch in 3–6 days, larvae develop through four instars over 12–15 days, pupae develop for 3–7 days, and adults live for approximately 7–10 days. At any given time, all stages are present simultaneously, which is why a minimum of 4 weeks of consistent treatment is needed to break the cycle completely.

7 Methods to Get Rid of Gnats

The most effective approach uses several methods simultaneously. Here are all seven, ranked roughly by effectiveness and importance:

Method 1: BTi Soil Drench (Most Effective)

Bacillus thuringiensis israelensis (BTi) is a naturally occurring soil bacterium that produces proteins toxic specifically to the larvae of mosquitoes, fungus gnats, and a few other dipteran insects. It is completely safe for plants, pets, humans, beneficial insects, earthworms, and aquatic organisms. It is the single most effective treatment for fungus gnat larvae available without professional-grade chemicals.

Products Containing BTi

  • Mosquito Bits — the most widely available consumer product; contains BTi granules
  • Gnatrol — a professional-grade liquid BTi concentrate
  • Microbe-Lift BMC
  • BT dunks / Mosquito Dunks — the same BTi in a doughnut-shaped dissolving cake format

How to Apply

  1. Measure 1–2 tablespoons of Mosquito Bits (or follow the package rate for your specific product) into a container of 1 gallon (approximately 4 litres) of water
  2. Allow the mixture to steep for 30 minutes to 1 hour — this allows the BTi proteins to leach into the water
  3. Strain out the solid granules if desired (optional — leaving them in will not harm plants)
  4. Use this BTi-infused water to water your plants as normal, thoroughly saturating the soil
  5. Repeat weekly for 4 weeks

The BTi is ingested by feeding larvae in the soil, which then die within 24–72 hours. It has no effect on eggs, pupae, or adult gnats — hence the need for repeated weekly applications to catch each new larval cohort as it hatches from eggs.

Method 2: Yellow Sticky Traps

Yellow sticky traps placed at soil level (not raised up — gnats fly low, at or just above canopy level) capture adult gnats and serve two purposes: reducing the breeding population and providing a visual indicator of infestation level. When your traps start showing fewer gnats per week, the treatment is working.

Use one trap per pot for heavy infestations, and one per 3–4 pots for monitoring. Replace traps when they fill up or every 1–2 weeks. Yellow traps will also catch whitefly adults and other flying pests, making them a useful all-purpose tool. They will not eliminate a gnat infestation alone (they cannot reach larvae) but are an essential component of a combined treatment approach.

Method 3: Hydrogen Peroxide Soil Drench

A hydrogen peroxide soil drench is a fast-acting option that provides immediate larval kill through a chemical reaction rather than biological action.

How It Works

When a 1-part 3% hydrogen peroxide to 4-part water solution contacts moist soil, the hydrogen peroxide rapidly decomposes into water and oxygen. The rapid oxygen release creates a micro-environment hostile to larvae, killing them on contact. The reaction completes within a few hours and leaves no lasting chemical residue — the treated soil is simply well-oxygenated water.

Application

  1. Mix 1 part standard 3% hydrogen peroxide (available at any pharmacy) with 4 parts water
  2. Water the plant with this solution until it drains freely from the drainage holes
  3. The solution will fizz briefly in the soil — this is normal
  4. Repeat every 5–7 days for 3–4 treatments

Important: use only 3% hydrogen peroxide. Higher concentrations (available as hair bleach or pool chemicals) will damage plant roots. Do not apply to recently propagated cuttings or seedlings, which are more root-sensitive than established plants.

Method 4: Let the Soil Dry Out

This is simultaneously the simplest and most important method. Female fungus gnats will not lay eggs in dry soil, and larvae cannot survive without moisture. Allowing the top 2 inches of soil to dry completely between waterings — confirmed with the finger test rather than guessed by schedule — removes the fundamental conditions that allow gnats to breed.

For most houseplants, this means extending the time between waterings significantly. For drought-tolerant plants like succulents, cacti, snake plants, and ZZ plants, letting the soil dry completely is already the correct care practice. For moisture-loving plants like ferns and calatheas, this may be more challenging — but even these plants benefit from the soil surface drying briefly between waterings.

Crucially, this single change — correcting overwatering habits — is the primary reason fungus gnat infestations keep recurring. Without it, no other treatment will provide lasting results. For help with watering technique, see our guide on how to water houseplants.

Method 5: Cinnamon on Soil Surface

Cinnamon contains compounds including cinnamaldehyde that have documented antifungal properties. Since fungus gnat larvae feed partly on the fungal growth in potting mix, reducing this food source can make the soil less hospitable to larval development.

Sprinkle a thin, even layer of ground cinnamon across the soil surface and gently mix it into the top centimetre of soil. Reapply every few weeks as it gets watered in and loses potency. Cinnamon is most effective as a preventive and as a supplement to more direct treatments (BTi, hydrogen peroxide) rather than as a standalone solution. It will not kill existing larvae in high numbers but does contribute to making the soil environment less favourable.

Method 6: Diatomaceous Earth (DE) Top Dressing

Food-grade diatomaceous earth applied as a top dressing creates a physical barrier that kills crawling larvae attempting to reach the surface to pupate, and deters adult females from landing on the soil to lay eggs. The microscopic sharp edges of DE particles pierce the exoskeleton of insects, causing dehydration and death.

Apply a layer approximately 5mm thick across the entire soil surface. Reapply after watering, as DE loses effectiveness when wet. DE will not penetrate to kill larvae deep in the soil, but it is a useful surface treatment that complements soil drenches targeting larvae deeper in the root zone.

Method 7: Systemic Imidacloprid (Severe Cases)

For severe, persistent infestations that have not responded to 4–6 weeks of the above treatments, a systemic imidacloprid soil drench is the chemical option of last resort. When absorbed by plant roots and distributed through plant tissue, imidacloprid affects insects that feed on the plant — in this case, larvae feeding on plant roots.

Apply as a soil drench according to the product label. A single application provides several weeks of systemic protection. Do not use on edible plants, and be aware that imidacloprid is toxic to bees — avoid using it on flowering plants that could be visited by pollinators. It is also worth noting that imidacloprid targets root-feeding larvae specifically; it is not the most efficient option compared to BTi for a purely organic-matter-feeding population, but it is effective when combined with the other methods above.

Preventing Gnats Long-Term

Once you have eliminated an infestation, the following practices keep fungus gnats from returning:

Correct Watering as the Foundation

Always check soil moisture before watering — use the finger test (index finger inserted to the second knuckle; if moist, wait). The vast majority of fungus gnat infestations are a direct consequence of overwatering and will not recur in well-managed, appropriately dry soil.

Top Dress with Sand or Perlite

Adding a 1–2cm layer of coarse horticultural sand or perlite as a top dressing on your pots serves two functions: it dries out faster than organic potting mix (deterring egg-laying), and it provides less organic material for larvae to feed on near the surface. This is a particularly effective preventive on pots you know are at risk from overwatering.

Quarantine New Plants

Fungus gnats frequently arrive on the soil of new plants from nurseries. A new plant with persistently moist soil from its retail environment can introduce hundreds of eggs or larvae into your home. Follow our full plant quarantine protocol — keep new plants in a separate room for 2–4 weeks, allow the soil to dry properly, and monitor for adult gnat activity before integrating with your collection.

Improve Potting Mix Drainage

Heavy potting mixes that retain excessive moisture for prolonged periods create chronic gnat-friendly conditions even with correct watering. Consider amending your potting mix with 20–30% perlite or coarse pumice to improve drainage and aeration, which naturally reduces the time the soil stays moist after watering.

Frequently Asked Questions

With consistent treatment, expect 4–6 weeks to fully eliminate fungus gnats. The lifecycle from egg to adult is approximately 3–4 weeks at room temperature. You need to treat through multiple complete cycles to catch all eggs, larvae, and adults. The most common reason treatments fail is stopping too early — adults may disappear before all larvae in the soil are dead.
Fungus gnat larvae primarily feed on decaying organic matter in the soil, but in high populations they will also feed on plant roots, root hairs, and root crowns. This root feeding can cause wilting, stunted growth, and yellowing that is easily confused with overwatering. Seedlings and young plants are most at risk — larvae can kill seedlings at high population densities.
At the correct dilution (1 part 3% hydrogen peroxide to 4 parts water), hydrogen peroxide will not harm established plants. It releases oxygen rapidly in the soil, which kills larvae and eggs but dissipates within hours with no lasting effect on soil chemistry. Do not use higher concentrations or undiluted hydrogen peroxide, as this can damage roots. Avoid using on newly rooted cuttings or seedlings, which are more sensitive.
No — fungus gnats and fruit flies are different insects. Fungus gnats (family Sciaridae) are dark-bodied with long legs and are specifically associated with moist plant soil. Fruit flies (Drosophilidae) are tan or orange-brown, smaller, and are attracted to fruit, fermented materials, and organic waste — not plant soil. If the flies disappear when you take away fruit but persist around plant pots, they are almost certainly fungus gnats, not fruit flies.
Cinnamon has antifungal properties that can reduce the fungal matter that fungus gnat larvae feed on, and some studies show it inhibits their development. It is a gentle supplementary measure rather than a standalone treatment. Sprinkle a thin layer of powdered cinnamon on the soil surface and mix it into the top centimetre. It works best as a preventive or as part of a multi-method approach alongside letting the soil dry out and applying BTi.