Fruit flies in plants are usually fungus gnats, so fix the compost
Tiny flies lifting off a houseplant are nearly always fungus gnats breeding in damp compost. Dry the surface, add grit, trap the adults. Real fruit flies only breed near a plant when something in or beside the pot is rotting.
By The Pest GuyLast updated
The short answer
Water the plant and watch. Where the flies come from tells you which fly you have.
If small dark flies rise out of the compost when you water, they're fungus gnats, also called sciarid flies. The University of Wisconsin says they are often mistaken for fruit flies, and they are two different insects. The larvae live in the compost and feed on dead roots, decaying plant material and fungus, so that's where the fix goes: let the top dry out between waterings, put a layer of grit on it, and catch the adults on yellow sticky traps.
Real fruit flies breed in fermenting material. Near a plant that means a rotting bulb, fallen fruit, or a mat of wet dead leaves. Bin that and trap the adults with cider vinegar, and it ends. The same vinegar trap won't catch fungus gnats, which makes it a handy test of which one you've got.
One thing to skip: spraying the plant with vinegar or washing-up liquid. The RHS advises against both.
Every fix for flies in a plant pot, and what it actually hits
Most fixes only reach one stage. Traps catch adults in the air, while the next lot grows up in the compost.
| Fix | What it hits | Works on | Source |
|---|---|---|---|
| Let the top of the compost dry between waterings | Eggs and larvae. Females lay in the surface layer, and the larvae need it damp | Fungus gnats | RHS; UC IPM; University of Wisconsin |
| A 1 to 2.5 cm layer of grit, gravel or coarse sand on top | Egg-laying. It keeps the surface drier | Fungus gnats | Gardeners' World; University of Wisconsin |
| Yellow sticky traps | Adults only. Cuts the numbers flying; the larvae in the compost carry on | Fungus gnats | RHS; UC IPM |
| A chunk of raw potato, cut side down on the compost | A check, not a cure. Look for larvae on it after three or four days | Fungus gnats | UC IPM; University of Wisconsin |
| Nematodes (Steinernema feltiae), watered in | Larvae in the compost. Living, so mail order and used soon after they arrive | Fungus gnats | RHS |
| Repot into fresh compost | Whatever is living in the old compost | Fungus gnats | NC State Extension |
| Bin the rotting bulb, fallen fruit or wet dead leaves | The breeding site itself | Fruit flies | University of Wisconsin |
| Cider vinegar trap | Adults, drawn by the smell of fermentation | Fruit flies. Vinegar traps do not work for fungus gnats | University of Wisconsin; Maine DACF |
| Vinegar or washing-up liquid sprayed on the plant | Often the plant, the soil and what lives in it | Neither. The RHS advises against household products as pesticides | RHS |
Sources: RHS (fungus gnats; chemicals in gardens; biological control); UC IPM Pest Notes, Fungus Gnats; University of Wisconsin Extension (fungus gnats on houseplants; fruit flies in the home); Maine DACF, vinegar flies; NC State Extension; Gardeners' World. The grit depth spans Gardeners' World's 1 cm and the University of Wisconsin's half an inch to an inch.
Why the flies in your plant are nearly always fungus gnats
They breed in the pot itself, and wet compost is what they need.
The RHS describes adult fungus gnats as dark greyish brown flies, mostly 3 to 4 mm long. Their larvae are slender whitish maggots up to 6 mm long with black heads, living in the compost. NC State Extension puts the difference from fruit flies simply: gnats are more attracted to moist soil than to ripening fruit. Fruit flies are the brownish-yellow ones with red eyes. If you want the full side-by-side, I've put it in fruit flies vs fungus gnats, and what fruit flies look like covers the other tiny flies too.
Wet compost is the whole story. The RHS says fungus gnats are more numerous in compost that is constantly wet, and females lay their eggs in the surface layer, where they hatch within a few days. UC IPM puts a full generation at about 17 days in warm conditions (24 C). The University of Wisconsin says three to four weeks, and the RHS about a month in summer.
That timing is why sticky traps on their own feel endless. Every adult you catch is replaced by larvae that were already in the compost when you put the trap up. You need the compost to stop being a nursery, and then the traps mop up what's left.
Two more things worth knowing. The University of Wisconsin says the problem often starts in autumn, when plants that spent the summer outside come back in with gnats already in the pot. And it's mostly a nuisance. The RHS says adults do not damage plants and established plants are unlikely to be harmed by the larvae. Seedlings and cuttings are the ones at risk.
Sorting out fungus gnats: the compost first, then the air
Do these in order. The first two stop new flies. The rest deal with the ones already there.

Let the top dry out. UC IPM's advice is to let the surface of container soil dry between waterings, avoid overwatering and make sure the pot drains. That takes away the damp layer the females lay into.
Put grit on top. Gardeners' World says a 1 cm mulch of gravel, grit or glass pebbles stops house plant flies laying their eggs. The University of Wisconsin suggests half an inch to an inch of coarse sand or fine gravel, which keeps the surface drier.
Trap the adults. Yellow sticky traps catch the flying ones. UC IPM suggests cutting them into small squares on sticks pushed into the pot. They cut the numbers. They don't touch the larvae.
Check the compost with a potato. UC IPM says chunks of raw potato, cut side down on the compost, draw the larvae. The University of Wisconsin says to check slices after three or four days. Larvae on the potato mean the compost is still breeding gnats.
If they keep coming, use nematodes. The RHS lists Steinernema feltiae, a nematode watered into the compost, among the biological controls for fungus gnats. They're living, so they usually come by mail order and want using soon after they arrive, in moist compost. Predatory mites and a rove beetle are the other options the RHS names, mostly for greenhouses.
Or start again. NC State Extension includes repotting into fresh soil. For one badly affected plant, that's the clean break.
Why I wouldn't spray vinegar or fairy liquid on the plant
The RHS advises against both, and the larvae are out of reach of a spray anyway.
The RHS says it is not advisable to use household products, such as bleach, vinegar or washing-up liquid, as pesticides. Gardeners who mix their own solutions often damage plants, soil and soil life, and can harm the wider environment. There's a simpler problem too: gnat larvae are in the compost, so a spray over the leaves misses the part that's breeding.
If you do reach for something off the shelf, read the label before you buy it. The RHS is plain that following the label instructions is a legal requirement, and the HSE database will tell you whether a product is authorised for use in the UK. It's the same rule as using fly spray on fruit flies: a spray kills what it hits, and the source carries on.
When it really is fruit flies near your plants
It happens. It just means something in or beside the pot is rotting.
Fruit flies feed and breed on the yeast in decaying and fermenting material. The University of Wisconsin's list of breeding sites includes rotting bulbs and wet, decaying plant material, alongside the usual bins, drains and sour mops. So check the pot for a bulb gone soft, fruit that's dropped off a citrus or tomato plant, dead leaves lying wet on the compost, or kitchen scraps you've buried as feed. And check the fruit bowl on the same windowsill.
They breed fast. Maine's agriculture department says a female lays up to 500 eggs in the skins of fruit and vegetables, and the University of Wisconsin puts the full life cycle at eight to ten days. That's why the order matters: the University of Wisconsin says the only way to stop them completely is to find and get rid of the breeding site. A trap then catches the adults that hatched before you did.
If you can't find anything in the pot, finding fruit flies breeding in the house walks through the caddy, the recycling and the sink, and where fruit flies come from explains how they seem to appear from nowhere. If the tiny flies are by the sink rather than the plant, they may be drain flies, which flies in the house covers.
Cider vinegar works because these are, quite literally, vinegar flies: Maine names them for their attraction to the sour smell of fermentation. The University of Wisconsin is just as clear that vinegar traps don't work for fungus gnats. So a trap by the plant does two jobs. If it fills, you had fruit flies and it's catching them. If it stays empty while flies keep lifting off the compost, you've got gnats, and the table above is your fix. There's more on what makes a fruit fly trap catch and keep them if you're choosing one.
If it is fruit flies, this is the trap I'd stand beside the plant
Only for real fruit flies, after the rotting thing is in the bin. It won't do anything about fungus gnats in the compost. Stand it right next to the pot. If it stays empty and the flies keep coming up out of the compost, go back to the table.
What I’d use
Reusable cider vinegar trap
Escape-proof fruit fly trap
A two-part cup and lid you fill with about 25 ml of cider vinegar and stand by the fruit bowl.
Eight slots in the lid feed a funnel that drops flies through one 4 mm hole into the dark middle of the cup. The brightest points a trapped fly can see are pinholes too small to get through, set away from the real exit, so the way out is the place they are least likely to look.
- Ways in
- Eight slots in the lid, into one funnel
- Way out
- One 4 mm hole, under the solid centre of the lid
- Holds
- About 25 ml of vinegar, to the moulded fill line
- Size
- 6.7 cm across, 5.4 cm tall
- Refills
- None to buy. It runs on cider vinegar from the cupboard
Watch out for
- Vinegar and washing-up liquid not included.
- Made for fruit flies. Flies from a plant pot or drain need the source found.
- Tip, rinse by hand and refill once it fills up.
That link earns me nothing. It is not an affiliate link, no brand pays for a mention here, and I get the same whether you buy this or ignore it. It is on the page because it is what the job takes.
No brand pays for a mention here, and nothing on this page earns me a commission. The card above links out to a shop, and I get the same whether you buy or ignore it. The link is there because finding the thing is the boring half of acting on advice, which is also why the watch-outs sit on the same card as the reasons to buy.
About this resource
The weight on this page is carried by the RHS's fungus gnat, chemicals and biological control advice, UC IPM's fungus gnat Pest Notes, the University of Wisconsin Extension's fact sheets on fungus gnats and fruit flies, and Maine's agriculture department on vinegar flies. Product details on the trap come from its listing only.
The honest limit is identification. This page can tell you what each fly usually means and how to check; it can't tell you which one is in your pot from a description. No brand pays for a mention here.
Common questions
How do I get rid of little flies around my indoor plants?
Treat the compost, because that is where they breed. Little flies around a houseplant are nearly always fungus gnats, and the RHS says they are more numerous in compost that is constantly wet. Let the top of the compost dry between waterings, add a layer of grit or gravel, and use yellow sticky traps for the adults already flying. If they keep coming, water in nematodes (Steinernema feltiae) or repot into fresh compost.
How do I get fruit flies out of a plant?
First check they really are fruit flies. If they are coming out of the compost, they are almost certainly fungus gnats, which breed there, and the University of Wisconsin says vinegar traps don't work on them. If there is a rotting bulb, fallen fruit or a mat of wet dead leaves in the pot, that can breed real fruit flies: bin it, then trap the adults that are left with cider vinegar.
Can I spray my plants with vinegar to get rid of gnats?
I wouldn't. The RHS says it is not advisable to use household products such as vinegar or washing-up liquid as pesticides, and that home-mixed solutions often damage plants, soil and the things living in it. Gnat larvae live in the compost anyway, so a spray on the leaves misses them. Drying the surface and a grit top layer go after the larvae without hurting the plant.
What can I spray on my plants for fruit flies?
Nothing, as a rule. Fruit flies breed in fermenting material, not on a healthy plant, so the answer is to remove what is rotting and trap the adults. If you ever buy an approved insecticide for anything, the RHS points out that following the label is a legal requirement, and the HSE database will tell you whether a product is authorised in the UK.
Is fairy liquid ok for plants?
Not as a pest spray. The RHS names washing-up liquid among the household products it advises against using as pesticides. A drop of it does belong in a cider vinegar trap, where it breaks the surface tension so flies sink, but that trap sits beside the plant, not on it.
Do fungus gnats damage plants?
Rarely, on a grown plant. The RHS says adult fungus gnats do not damage plants and established plants are unlikely to be harmed by the larvae. Seedlings and cuttings are the exception: UC IPM says large numbers of larvae can damage roots and stunt growth in young plants.
Do the flies in my plants bite?
No. UC IPM says adult fungus gnats don't damage plants or bite people, and their presence is mainly a nuisance.