The little flies in the compost
About 7 minutes to read. Last looked at Sunday, the 6th of September, 2026.
Small dark flies drifting up out of a pot when you walk past it, or gathering on a window, are almost always fungus gnats. They are the commonest houseplant pest there is, they are more annoying than dangerous, and they are one of the very few pests that tell you something specific about how you are looking after your plants.
What they are
A fungus gnat is a small dark fly, two or three millimetres long, with long legs and a weak wandering flight. They do not bite, and they do not eat leaves. They are often mistaken for fruit flies, which are rounder, browner, faster and interested in the fruit bowl rather than the plants.
The adults live about a week and do very little except mate and lay eggs on damp compost. The eggs hatch in a few days into tiny translucent larvae with black heads, which live in the top three or four centimetres of the compost and eat fungus, algae and decaying organic matter. Two to three weeks later they pupate and the next generation of adults appears. The whole cycle takes about three or four weeks in a warm room, which is why the numbers seem to explode from nothing.
The important part of that description is where the larvae live: in the top few centimetres, in damp compost. Everything that works follows from it.
Whether they matter
For an established plant, honestly, not very much. The larvae are after fungus rather than roots, and a healthy monstera with a full pot of roots will not notice them.
They matter in three cases. Seedlings and cuttings, where a few larvae grazing on fine new roots can kill the plant outright. Very large populations, where there is not enough fungus to go round and they turn to root hairs. And your own patience, which is a legitimate reason to act.
The other thing they matter for is what they tell you. A pot with fungus gnats in it is a pot whose surface is permanently damp, and permanently damp compost is the leading cause of root rot. The flies are often the first visible sign of a watering habit that is going to cost you the plant in six months. That is worth more than the nuisance.
Where they came from
Almost always in a bag of compost or on a new plant. Bagged compost frequently contains eggs or larvae, particularly if the bag has been open or stored damp, and a plant bought from a shop that waters everything daily will usually bring a few with it.
You did not do anything wrong to get them. What decides whether you keep them is what happens next, because they can only build up a population where the compost surface stays wet.
What actually works
Let the top dry out. This is the whole answer and everything else is support. Let the top three to four centimetres of compost dry properly between waterings, and the eggs and young larvae die. For most houseplants that is what they wanted anyway. Push a finger in before every watering, and if it comes out damp, wait.
For a plant that genuinely must stay moist, a Boston fern or a calathea, water from below instead, standing the pot in water for twenty minutes and taking it out. The root ball gets what it needs and the surface stays dry.
Cover the surface. A centimetre of horticultural grit, coarse sand or perlite on top of the compost gives the adults nowhere to lay and dries out within hours of watering. It is a genuinely effective barrier and it looks better than the compost did.
Yellow sticky traps. These catch adults. They will not touch the larvae, so they never finish the job on their own, but they are useful for two reasons: they take breeding adults out of circulation, and the number caught per week tells you honestly whether you are winning.
Bottom water for a few weeks. While you are clearing an infestation, watering from below keeps the surface dry through several generations.
Repot the worst pot. If one plant is the source, take it out, shake off as much of the old compost as you reasonably can, and repot into fresh with grit on top. Choose the right time of year if you can, but a badly infested pot is a rescue rather than a routine repot.
For a stubborn case there are two biological controls that work and are safe indoors: a soil drench of Bacillus thuringiensis israelensis, which is a bacterium fatal to the larvae and to nothing else you care about, and predatory mites or nematodes. Both are worth it for a seedling tray and excessive for three pots on a windowsill.
What does not work
Cinnamon, washing up liquid and hydrogen peroxide. The first has a mild antifungal effect that does not kill larvae; the second is a surfactant that damages roots at any useful concentration; the third kills larvae on contact and is gone within minutes, so the eggs hatch behind it. None of them address the damp surface, which is why the flies always come back a fortnight later.
Spraying the room. The adults are not the problem and they live a week anyway.
Repotting into new compost without changing how you water. The new compost stays wet, the few survivors breed, and you are back where you started with a stressed plant.
How long it takes
Three to four weeks, which is one full life cycle. The first week feels like nothing is happening, because the adults you can see are already alive and will keep flying. In the second week the trap catch drops. By the fourth there should be almost nothing.
If they are still there after six weeks, one pot is staying wet, and it is usually the one nobody suspects: a plant in a decorative pot with no drainage hole, or one that gets a splash every time somebody walks past it.
And while you are looking at the compost
If the pot also smells sour, or the lower leaves are yellowing, or the stem is soft at soil level, the flies are the smaller half of the problem. That is root rot, and it wants a different response: out of the pot, dead roots cut away, fresh compost, a smaller pot.
The diagnoser will ask what else you are seeing before it tells you anything, which is the right order for a symptom that has four possible causes. If it turns out to be a watering habit rather than a pest, the log works out an interval from the plant, its light and its pot size, which is a better starting point than a day of the week.
Two plants are worth naming here because they are the usual casualties. A peace lily collapses dramatically when it is dry and stands back up in an hour, which teaches people to water it constantly, and constant watering is what the gnats want. And a pothos that has sat in wet compost for a year will often come back from cuttings even when the parent will not, so a badly rotted one is worth a jar of water and a windowsill before it goes in the bin.
The entries this touches
- Peace lilySpathiphyllum wallisii
- PothosEpipremnum aureum
- CalatheaGoeppertia orbifolia
- Swiss cheese plantMonstera deliciosa
- Boston fernNephrolepis exaltata
Where to use it
Questions from the margin
Are fungus gnats harmful to plants?
The adults are harmless and only irritating. The larvae eat fungus and rotting matter in the top few centimetres of compost, and in large numbers they will also graze on fine roots, which matters most to seedlings and cuttings. A big plant rarely suffers from them directly.
Why do I keep getting fungus gnats?
Because the top of the compost is permanently damp, which is the only condition their eggs hatch in. They usually arrive in a bag of compost or on a new plant, but they only multiply if the surface never dries out.
Do yellow sticky traps get rid of them?
They catch adults, which tells you how bad it is and slows the breeding, but they do nothing to the larvae in the compost. Traps alone will reduce the numbers and never finish the problem.
Will letting the plant dry out kill them?
Letting the top three to four centimetres dry between waterings breaks the life cycle, because the eggs and young larvae die in dry compost. That single change does more than any product, and it usually clears an infestation in three to four weeks.