How to Get Rid of Fungus Gnats in Houseplants

November 15, 2026 6 min read

Image of fungus gnat trap on houseplant

 

At a Glance: To get rid of fungus gnats, dry out the top layer of soil, catch the adults with yellow sticky traps, and treat the larvae in the soil with a biological control like Bti. Fungus gnats are driven by too much moisture, not poor soil, so the lasting fix is better watering habits and good drainage. Most houseplant infestations clear within a few weeks once the soil dries out.

The Long-Term Defense Against Fungus Gnats

Fungus gnats take advantage of weak, waterlogged soil. See how Dr. JimZ feeds biologically balanced soil that helps houseplants grow stronger roots.

Learn More About Dr. JimZ

Fungus gnats are one of the most common pests on indoor plants. These tiny flies hover around the soil surface and leaves, and in large numbers they are hard to ignore. They are more of a nuisance than a danger to healthy plants, and the damp conditions that cause them are easy to change.

What Are Fungus Gnats?

Many common fungus gnats belong to the Bradysia species group and are known as dark-winged fungus gnats. These mosquito-like insects are about an eighth of an inch long, with slender legs, dark bodies, and one pair of wings. It is easy to confuse them with a fruit fly, but the two are not the same. A fruit fly is rounder and tan and feeds on ripening fruit, while fungus gnats are darker and stay near moist soil.

The Fungus Gnat Life Cycle

That attraction to moist soil is what lets an infestation take hold. Females lay their eggs in the upper layer of damp soil, where the larvae hatch and begin feeding. These tiny, translucent larvae have black heads and live in the top couple of inches of soil, feeding on fungi, decaying organic matter, and sometimes plant roots. The reproductive cycle typically takes a few weeks, depending on temperature, so a fungus gnat infestation can involve several overlapping generations. Breaking the life cycle at multiple stages is often necessary to get rid of them.

How to Get Rid of Fungus Gnats

Getting rid of fungus gnats works best when you combine several methods to target both the flying adults and the larvae developing in the soil.

Dry Out the Soil

Start by letting the top one to two inches of soil dry out between waterings. Dry soil kills many fungus gnat eggs and larvae and makes the soil surface less attractive to egg-laying females. As Colorado State University Extension notes, this single change does more than any spray, which only kills the adults you can see and leaves the larvae in the soil.

Trap the Adults

Next, target the adult fungus gnats so they stop laying eggs:

  • A yellow sticky trap set at the soil surface catches adults as they emerge. Yellow sticky traps are the standard tool because the color draws the gnats in.

  • An apple cider vinegar trap also works. Fill a shallow dish with apple cider vinegar and a few drops of dish soap to trap and drown the gnats.

Treat the Larvae

Trapping the adults alone will not end a fungus gnat infestation because the larvae continue developing in the soil. Biological control methods can target the larvae without relying on harsh chemical pesticides:

  • Bti, short for Bacillus thuringiensis israelensis, is a naturally occurring bacterium that targets fungus gnat larvae. Products like Mosquito Bits can be mixed with water and applied to the soil to help control an infestation.

  • Beneficial nematodes, especially Steinernema feltiae, are microscopic roundworms that seek out and infect gnat larvae in the soil, helping reduce their numbers.

  • Predatory mites that live near the soil surface feed on fungus gnat eggs and young larvae, providing another form of biological control. They work best when introduced before an infestation becomes severe.

Fungus gnat treatment checklist infographic

A couple of common home remedies can also help suppress an infestation:

  • Hydrogen peroxide: A soil drench made with one part 3% hydrogen peroxide and four parts water can kill larvae on contact. However, it may also harm beneficial soil microbes, so use it cautiously.

  • Diatomaceous earth: A thin layer sprinkled over the dry soil surface can help control fungus gnats that come into contact with it. It becomes less effective when wet.

Because these home remedies come with trade-offs, the biological control options above are usually the better first choice. The table below sums up all the methods and what each one targets.

Method What It Targets How It Works
Letting the soil dry Eggs and larvae Removes the moisture larvae need to survive
Yellow sticky traps Adult gnats Catches flying adults at the soil surface
Apple cider vinegar trap Adult gnats Lures and drowns adults
Bti (mosquito bits or mosquito dunks) Larvae Kills only fly larvae with a soil-safe bacteria
Beneficial nematodes Larvae Hunts and kills larvae in the soil
Hydrogen peroxide drench Larvae Kills larvae on contact when mixed at one part peroxide to four parts water
Diatomaceous earth Larvae and adults Dries out insects at the soil surface

Why Fungus Gnats Show Up in Houseplants

Fungus gnats need two things to thrive: moisture and a food source.

Too Much Moisture

Of the two, moisture is the one you can control most easily. Adult fungus gnats are attracted to moist soil, where the larvae develop and depend on moisture to survive. When an indoor plant sits in soggy soil, the surface remains damp, creating the moist conditions that allow eggs to hatch and larvae to grow. Overwatering and poor drainage are common causes, so adjusting your watering routine can help prevent an infestation without compromising plant health. Many houseplants need less water in fall and winter, and following a summer watering schedule can leave the potting mix wet for too long.

A Food Source in the Soil

The second factor is food. Fungus gnat larvae feed on fungi and decaying organic matter, and they can also chew on plant roots and fine root hairs. According to UC IPM, the larvae mostly eat organic material, but in large numbers they also chew the plant's roots, which can stunt seedlings and younger plants.

Even so, a rich, biologically active soil is not the problem on its own. The trouble is a soggy mix of poorly broken down material that stays wet. Soil that dries between waterings is far less welcoming to gnats than a wet, raw potting mix.

How to Prevent Fungus Gnats

Once the fungus gnats are gone, a few simple habits can help keep them from returning:

  • Allow the top inch or two of potting soil to dry between waterings when the plant can tolerate it. Reducing damp soil conditions helps discourage egg-laying.

  • Use pots with drainage holes and empty saucers to prevent standing water.

  • Water from the bottom when possible to help keep the soil surface drier.

  • Inspect new plants and those that spent the summer outdoors before bringing them inside, since both can carry gnats.

  • Remove fallen leaves and other decaying material from pots, and avoid keeping the soil constantly wet. Allowing the upper layer to become dry soil between waterings helps interrupt the reproductive cycle.

How to keep fungus gnats away infographic

Build Healthier Soil for Stronger Houseplants

Fungus gnats take advantage of weak, waterlogged soil. The long-term defense is soil that drains well and stays biologically balanced, so your plants grow strong roots and shrug off the next wave of pests.

Once your soil dries out and the gnats clear, your plants will need clean, gentle nutrition to bounce back. Dr. JimZ Houseplant Magic™ is formulated specifically for indoor containers, delivering balanced, biologically correct nutrients without synthetic salts that burn roots or stall growth. Dry out your soil, trap and treat the gnats, then feed the soil to keep your houseplants healthy. Shop Dr. JimZ to get started.

The Long-Term Defense Against Fungus Gnats

Dr. JimZ Houseplant Magic is formulated specifically for indoor containers, delivering balanced, biologically correct nutrients without synthetic salts that burn roots or stall growth.

Shop Houseplant Magic