Fungus gnats are tiny dark flies that hover around houseplant soil, and the single biggest reason they’re in your home is overwatering. The adults are mostly harmless, but their larvae live in the top layer of moist potting mix, feeding on fungi, organic debris, and occasionally plant roots. Getting rid of them comes down to cutting off the moisture they need to reproduce, then targeting the larvae already in the soil.
Why Fungus Gnats Show Up
Female fungus gnats lay tiny eggs in moist organic material, and the consistently damp soil of an overwatered houseplant is ideal habitat. The larvae hatch and feed in that wet layer, going through several stages before pupating and emerging as adults that immediately start the cycle again. A single pot can produce multiple overlapping generations, which is why a minor problem can escalate quickly.
Your potting mix matters too. Research published in Greenhouse Product News found that fine-textured media (peat and vermiculite blends typically used for seed starting) supported significantly more larvae than coarser mixes containing bark. Interestingly, swapping peat for coconut coir in fine-textured mixes actually made things worse, producing more than three times as many larvae. In coarser mixes, the opposite was true: peat harbored more larvae than coir. The takeaway is that any fine, moisture-retentive soil holds more water near the surface and creates better conditions for fungus gnats to thrive.
The Damage Larvae Actually Cause
Most of the time, fungus gnat larvae feed on decaying organic matter and fungi in the soil, not your plant’s roots. Healthy, established houseplants can tolerate a moderate population without showing any symptoms. The real risk is to seedlings, cuttings, and young plants with delicate root systems, where larvae can chew through fine root hairs and open the door to fungal infections.
Signs of a heavy infestation include unexplained wilting despite moist soil, yellowing lower leaves, and stunted growth. In severe cases, you might notice shiny slime trails on the soil surface that look like tiny snail tracks. If your adult plants look fine but gnats are annoying you, the priority is breaking the breeding cycle rather than worrying about root damage.
Drying Out the Soil
This is the most effective single step you can take. Fungus gnat eggs and larvae need consistently moist conditions to survive. Letting the top inch or two of soil dry completely between waterings kills larvae and makes the surface inhospitable for egg-laying. UC IPM’s primary recommendation is simply to allow container soil to dry between waterings and ensure good drainage.
Moisture levels in the middle range (roughly 50 to 70 percent soil moisture) actually produce the most larvae in peat-based mixes. Very wet and very dry conditions both reduced larval numbers. So you don’t need to stress your plants with extreme drought. Just stop keeping the soil surface perpetually damp. Bottom watering, where you place the pot in a tray of water and let the soil wick moisture upward, keeps the top layer drier while still hydrating roots.
Yellow Sticky Traps
Yellow sticky cards placed near the soil surface catch adult gnats and give you a visual read on how bad the problem is. Orienting them horizontally, facing the soil, works better for fungus gnats than hanging them vertically, since adults emerge from and rest on the growing media.
That said, UC IPM notes that sticky traps are better for monitoring than for actual control. They capture flying adults, but the larvae doing the feeding and growing are in the soil where traps can’t reach them. Sticky traps are useful as part of a combined approach: they reduce the number of adults laying new eggs while other methods target larvae below the surface. If you’re still catching lots of adults after two to three weeks of letting soil dry out, the infestation is ongoing and you need to add another control method.
Hydrogen Peroxide Soil Drench
A hydrogen peroxide drench kills larvae on contact without harming plant roots. Cornell Cooperative Extension recommends mixing one part standard 3% hydrogen peroxide with four parts water and pouring it directly over the soil. The solution fizzes as it works through the potting mix, and the oxygen released in the reaction is what kills the larvae. After it breaks down, you’re left with plain water, so there’s no chemical residue to worry about.
This works best as a targeted treatment when you know larvae are present, not as ongoing prevention. Let the soil dry first, then drench, then return to a more careful watering schedule. You may need to repeat once a week for two or three rounds to catch larvae that were in the egg stage during the first application.
Beneficial Nematodes
For persistent or large-scale infestations, microscopic nematodes (specifically a species sold as “SF nematodes”) offer biological control. These are living organisms you mix into water and apply to the soil. They actively cruise through the growing media searching for larvae, enter them, and release bacteria that kill the host within a few days.
The nematodes need specific conditions to work. Soil temperature should be between roughly 46°F and 86°F, which covers most indoor environments. The soil needs to stay moist for about two weeks after application so the nematodes can move through it. This creates a tension with the “let the soil dry out” advice, so timing matters. Apply nematodes, keep the soil lightly moist for two weeks to let them do their job, then shift back to a drier watering routine once the population is under control. If your home runs hot and soil temperatures exceed 86°F (possible on a sunny windowsill), water lightly before and after applying.
Other Physical Barriers
A layer of coarse sand, fine gravel, or decorative pebbles over the soil surface creates a physical barrier that discourages egg-laying. Females need access to moist organic material, and a half-inch of inorganic topping dries out quickly and makes the surface unappealing. This won’t eliminate larvae already in the soil, but it slows new generations from establishing.
Repotting into a coarser, bark-based mix also reduces risk long-term. If you’ve been using a fine peat-and-vermiculite blend, switching to a chunkier mix with bark improves drainage and creates a less hospitable environment for larvae. When repotting, shake off as much of the old soil as the plant can tolerate, since that’s where eggs and larvae are living.
Putting It All Together
Fungus gnats are persistent because their lifecycle is short and overlapping generations mean new adults keep emerging even as you kill larvae. The most reliable approach combines several methods at once: let the soil dry between waterings, set horizontal sticky traps to catch adults, and use either a hydrogen peroxide drench or beneficial nematodes to kill larvae in the soil. Top-dressing with sand or gravel adds a physical barrier against new egg-laying.
Expect it to take three to four weeks to fully break the cycle. You’ll likely see adult numbers on your sticky traps peak in the first week, then steadily decline. If you’re still seeing significant numbers after a month of consistent effort, check whether you have another moisture source nearby, like a drip tray that stays full, a compost bin, or another pot you forgot to treat. Fungus gnats will migrate between any available moist organic material in your home.