Problems & fixes

How to Get Rid of Fungus Gnats in Houseplants (For Good)

Tiny black flies around your plants? A simple plan to break the fungus gnat life cycle — dry the soil, trap the adults and treat the larvae — plus how to stop them coming back.

Updated December 2, 2026

This guide contains affiliate links. If you buy through them we may earn a small commission at no extra cost to you. Learn more.

If tiny black flies drift up every time you water or brush past a plant, you almost certainly have fungus gnats. They're one of the most common indoor plant pests and, thankfully, mostly a nuisance rather than a threat. Adults don't bite, and healthy plants usually shrug them off. They are, however, annoying — and in big numbers their larvae can damage young plants and seedlings.

What fungus gnats are

Fungus gnats are small (about 1/8 inch), dark, weak-flying insects that hang around soil and windows. The adults lay eggs in the top layer of damp potting mix. The eggs hatch into tiny translucent larvae with black heads that live in the top couple of inches of soil, feeding on fungi, decaying organic matter and sometimes fine roots.

The whole cycle, from egg to adult, can take as little as three to four weeks in a warm home. That's why a few gnats can become a cloud — and why you need to treat for several weeks, not just once.

Not sure it's fungus gnats? Flies that hover around fruit bowls and the kitchen bin are more likely fruit flies, which have a different fix.

The 3-part plan

To get rid of fungus gnats, you need to deal with the adults and the larvae, and remove the damp conditions they breed in.

1. Let the soil dry out

Wet soil is the gnats' nursery, so this step does the most. Let the top 1–2 inches of soil dry completely between waterings (see our watering guide). Many larvae die when the surface dries out, and adults avoid laying eggs in dry soil.

Two habits help:

2. Trap the adults

Yellow sticky traps catch flying adults before they can lay more eggs. Stick one in the soil of each affected pot, just above the surface. They also work as a monitor — if the traps stay clear for a couple of weeks, you're winning.

Traps alone won't solve the problem, because they don't touch the larvae in the soil.

3. Treat the larvae

Choose one of these:

Keep going for at least three to four weeks — long enough to cover a full life cycle — even after you stop seeing adults.

If nothing works

A heavy, persistent infestation usually means the soil is staying too wet. If a plant has been chronically overwatered, its mix may be broken down and soggy. Repot it into fresh, well-draining mix (our repotting guide explains how), removing as much of the old soil as you can, and adjust your watering.

How to prevent them

Fungus gnats are a sign that soil is staying wet — fix that, and they usually stop being a problem. For more on watering-related problems, see why leaves turn yellow.