Home / Pest guide

How to Get Rid of Fungus Gnats in Indoor Herbs

Tiny flies around your basil? Here is the extension-backed fix: dry soil, sticky cards and BTi.

Potted basil on a kitchen windowsill with a yellow sticky trap card and a hand lens (AI-generated image)

By the Countertop Harvest team ยท Last updated

We may earn a commission from links on this page. Full disclosure below.

Short answer: fungus gnats breed in moist potting mix. To get rid of them on indoor herbs, let the soil dry between waterings, catch adults with yellow sticky cards laid flat on the soil, and drench the soil with BTi (Bacillus thuringiensis israelensis), which Mississippi State Extension calls the most effective treatment. Keep it up for a few weeks, because their life cycle is about 21 days (University of Arizona Extension).

What are fungus gnats?

They are tiny dark flies, about 1/16 to 1/8 inch long (UVM). The adults are mostly a nuisance. The larvae do the damage: they live in the potting mix and feed on organic matter and root hairs (MSU). Heavy infestations can make young plants wilt (MU).

Why they love herb pots and smart gardens

Fungus gnat larvae thrive in growing media that stays too moist (MSU). Highly organic soil and fish emulsion can also favor them (Arizona). Herbs that are watered often, and smart gardens with constantly damp pods, give them what they need.

How to get rid of fungus gnats, step by step

  1. Confirm it's fungus gnats. Adults are tiny dark flies around the pot. Larvae are slender and white with shiny black heads, about a quarter inch long or less, and live in the soil (MSU).
  2. Let the soil dry. Overwatering favors the larvae. Allow the soil to dry properly between waterings (MSU).
  3. Trap the adults. Lay yellow sticky cards flat just above the soil, which UConn IPM finds more effective for gnats than standing them up.
  4. Drench with BTi. Water the soil with a BTi product to kill the larvae. Mississippi State Extension calls it the most effective treatment. Caterpillar Bt won't work.
  5. Repot if needed. For stubborn cases, remove and discard the growing media and repot in sterile media (MU).
  6. Keep monitoring. The life cycle is about 21 days (Arizona), so keep cards out and keep watering carefully for a few weeks.

BTi: the main treatment

BTi is a soil bacterium that targets the larvae of flies such as fungus gnats. Mississippi State Extension names Gnatrol and Knock-Out Gnats as two readily available brands and warns that Bt products labeled for caterpillars will not work on fly larvae. Summit Mosquito Bits are another BTi product that people use; check that the label covers your use before applying.

Larvae

BTi granules (e.g. Mosquito Bits)

Soil drench for gnat larvae. Follow the label.

Shop Mosquito Bits โ†’

Adults

Yellow sticky cards

Lay flat at soil level to trap and count adults

Shop yellow sticky cards โ†’

Other options

About Lost Coast Plant Therapy: it is sold as a "minimum risk" (EPA 25(b) exempt) spray for soft-bodied insects, mites and powdery mildew. The company says it is usable on edible plants and can be used up to the day of harvest (ingredients page, FAQ). That is the maker's claim, not an extension recommendation, so follow the label. Availability varies by state (state list). See Lost Coast on Amazon โ†’

Fungus gnats in a smart garden

The same steps apply. Lay a yellow card at pod level so you can see whether numbers are falling. Clean and dry the unit fully between grows. If you are starting over, see seed pod alternatives.

For other bugs, read our full indoor herb pest control (IPM) guide. Also see why is my indoor basil dying? and the best herbs to grow indoors.

Product spotlight: Lost Coast Plant Therapy for indoor herbs.

Sources

Frequently asked questions

How do I get rid of fungus gnats in my herbs?

Let the soil dry between waterings, trap adults with yellow sticky cards laid flat on the soil, and drench the soil with BTi to kill larvae. Mississippi State Extension calls BTi the most effective treatment.

Do fungus gnats hurt herbs?

Adults are mostly a nuisance, but larvae feed on root hairs, and heavy infestations can make young plants wilt (MSU, MU).

Will regular Bt kill fungus gnats?

No. Bt products for caterpillars don't work on fly larvae. You need Bacillus thuringiensis israelensis (BTi) (MSU).

How long does it take to get rid of fungus gnats?

Plan on a few weeks. The life cycle is about 21 days (University of Arizona Extension), so keep cards out and keep watering carefully.

Why do I have fungus gnats in my AeroGarden?

Constantly moist growing media favors the larvae (MSU). Use yellow cards at pod level and clean the unit between grows.

Free: 30-Day Indoor Herb Starter Planner

A printable week-by-week checklist for your first month of growing herbs indoors, sent with our newsletter.