Plant Flies: What They Are and How to Get Rid of Them

Those tiny flies hovering around your houseplants are almost certainly fungus gnats, the most common flying pest in indoor plants. They’re small, dark, and annoying, but the real problem isn’t the adults you see buzzing around. It’s the larvae living in your soil, feeding on organic matter and sometimes chewing on roots. The good news: a few straightforward changes to how you water and maintain your plants can eliminate them completely.

Identifying What’s Flying Around Your Plants

Three types of small flies commonly show up around houseplants, and telling them apart helps you choose the right fix.

Fungus gnats are the most likely culprit indoors. They’re delicate, dark brown or black flies about 1/8 inch long. They’re weak fliers, so you’ll often spot them resting on the soil surface rather than zipping around the room. Their larvae are whitish or translucent with a distinct black head, about 1/4 inch long when fully grown. If you gently disturb the top layer of soil in a pot and see tiny worm-like creatures, that confirms the diagnosis.

Shore flies look similar but are more robust, closer in build to fruit flies. They’re strong fliers, unlike fungus gnats, and their dark wings have five light-colored spots visible on close inspection. Shore flies feed on algae rather than soil fungi, so they tend to appear where there’s standing water on saucers, trays, or wet surfaces. Their larvae are opaque and lack the black head that fungus gnat larvae have. Shore flies are more of a greenhouse problem than a houseplant one.

Whiteflies are easy to distinguish because they’re white, not dark. If you tap a plant’s leaves and a cloud of tiny white insects lifts off, those are whiteflies, and they require a different approach since they feed on foliage rather than living in soil.

Why They Showed Up

Fungus gnats thrive in moist soil rich in organic matter. Overwatering is the single biggest reason they appear. When the top layer of potting mix stays consistently damp, it creates ideal conditions for both the fungi the larvae eat and the eggs the adults lay. A single female can deposit up to 200 eggs in clusters on the surface of moist soil, so a small problem becomes a big one quickly.

Potting mixes that contain a lot of peat, compost, or bark provide more food for larvae. Decaying leaves left on the soil surface, organic mulch, and even grass clippings mixed into compost-based soils all contribute. Plants that sit in saucers of standing water are especially vulnerable.

Can They Actually Hurt Your Plants?

The adult flies don’t damage plants at all. They don’t bite, and they don’t feed on leaves or stems. The larvae are the concern, and even then, damage in a home setting is rare. Fungus gnat larvae primarily eat decaying organic matter and fungi in the soil. When populations get high, though, they can feed on root hairs or tunnel into roots themselves.

Seedlings and young plants are most at risk because their root systems are small and delicate. Significant root damage and even plant death have been documented in cases where high larval populations combined with very moist, organically rich soil. Established houseplants with healthy root systems can tolerate moderate larval numbers without visible harm. If you notice unexplained wilting, yellowing, or stunted growth alongside lots of flying gnats, root feeding is worth considering as a cause.

How to Get Rid of Them

Let the Soil Dry Out

This is the most effective first step and costs nothing. Allow the top inch or two of soil to dry completely between waterings. Fungus gnat eggs and young larvae need moisture to survive, so breaking the wet cycle interrupts their reproduction. Bottom watering, where you place the pot in a tray of water and let the soil absorb moisture from below, keeps the top layer drier while still hydrating roots.

Yellow Sticky Traps

Inexpensive yellow sticky traps catch adult gnats before they can lay more eggs. Stake them into the soil near the base of the plant, positioned upright so they intercept the gnats’ flight path but don’t touch stems or leaves. These won’t solve the problem alone since larvae in the soil will keep maturing, but they reduce the breeding population and give you a visual gauge of how bad the infestation is. When the traps stop catching flies, you’re winning.

Hydrogen Peroxide Soil Drench

A simple soil drench kills larvae on contact without harming plant roots. Mix one part 3% hydrogen peroxide (the standard drugstore concentration) with four parts water and pour it through the soil as you would normally water. The solution fizzes on contact with organic matter and larvae. You can repeat this with each watering cycle until the gnats are gone.

Beneficial Nematodes

For persistent infestations, microscopic predatory nematodes offer biological control. These are tiny organisms you mix into water and apply to the soil, where they seek out and kill fungus gnat larvae. They’re safe for plants, pets, and people.

Application has a few requirements. Mix the nematodes in room-temperature water (59 to 69°F) and use the solution within 6 hours. Soil temperature should be between 44°F and 86°F. Keep the soil moist for two weeks after application so the nematodes can move through it and find their prey, but avoid creating so much moisture that water runs off. If you’re applying outdoors, do it in the morning, evening, or on a cloudy day, since nematodes are killed by UV light.

Top Dressing the Soil

A physical barrier on the soil surface prevents adult gnats from reaching the soil to lay eggs. A half-inch layer of coarse sand, fine gravel, or decorative pebbles works well. The material needs to be dense enough that gnats can’t crawl through it and should dry out quickly on top so it’s unappealing for egg-laying. This approach works best combined with adjusted watering habits.

Preventing Them From Coming Back

Once you’ve cleared an infestation, prevention comes down to moisture management. Water only when the top layer of soil is dry to the touch. Empty saucers and trays within 30 minutes of watering so pots never sit in standing water. Remove dead leaves from the soil surface promptly, since decaying plant material is food for larvae.

When repotting, choose a well-draining potting mix and make sure your pots have drainage holes. Mixes heavy in perlite or pumice drain faster and stay less soggy than pure peat-based blends. If you’re bringing a new plant home from a nursery or garden center, inspect the soil surface for tiny flies or larvae before placing it near your other plants. Quarantining new additions for a week or two lets you catch hitchhikers before they spread.

Fungus gnats reproduce fast, with overlapping generations developing simultaneously in warm indoor conditions. A consistent approach that targets both adults (sticky traps, reduced moisture on the soil surface) and larvae (soil drenches, nematodes, drying cycles) breaks the cycle more reliably than any single method alone.