Fruit flies in the worm farm: prevention, traps and control
Fruit flies and their maggots don’t harm worms, but they’re a nuisance. Freeze fruit scraps overnight, bury the food, cover the bedding and keep the bin from getting too wet and sour. A banana-skin bottle trap catches the adults that are left.
Fruit flies love fruit, so it’s no surprise to find them in worm farms, compost heaps and worm bins. They don’t harm the worms, but they quickly become a nuisance if they’re left to multiply. These are the methods that have worked for me over nearly 30 years of worm farming, first in South Africa and then in Germany. If you’ve found other kinds of maggots, read maggots in a worm farm.
- How do I recognise fruit flies and their maggots?
- Are fruit flies harmful to my worms?
- Where do fruit flies in a worm bin come from?
- How do I stop fruit flies before they start?
- Does moisture or pH have anything to do with it?
- How do I build a low-cost fruit fly trap?
- I already have a swarm. What now?
- What about fungus gnats?
How do I recognise fruit flies and their maggots?
Fruit flies are tiny, only 1–2 mm / ⅜–⅛ in. They have plump, pale brown or orange bodies, red eyes and a slow, hovering flight. Their maggots are slender, white and about 3–4 mm long, and you’ll find them in soft, fermenting fruit near the surface. Don’t confuse them with fungus gnats, which are black, slender and look like little mosquitoes.
Are fruit flies harmful to my worms?
No. Neither the flies nor their maggots harm compost worms. They’re a nuisance, though, especially indoors, and a big swarm tells you there’s more fruit in the bin than the worms can eat.
Where do fruit flies in a worm bin come from?
Most of them come in with the food. Adult flies lay eggs on fruit peels, especially bananas, and the eggs are too small to see. Once they’re in the warm, moist bin they hatch, and within about a week and a half there’s a new generation laying eggs of its own.
How do I stop fruit flies before they start?
- Freeze fruit scraps overnight before you feed them. This kills the eggs on the fruit and peels. One minute in the microwave also works.
- Bury the food. Dig a trench through the middle of the bedding, put the scraps in, and cover them with about 5 cm / 2 in of finished worm castings or bedding. The castings act as a natural barrier.
- Cover the bedding. Lay a sheet of damp newspaper, cardboard or sacking over the whole surface.
- Feed less fruit at a time. Only add more when the last meal has mostly gone.

Does moisture or pH have anything to do with it?
Yes. Fruit flies love a bin that is too wet and sour. Lots of fruit makes the bedding acidic, and soggy, airless bedding ferments. Both draw flies in. Keep the bedding as damp as a wrung-out sponge, mix in dry shredded cardboard when it’s soggy, and dust a pinch of agricultural lime or crushed eggshells over the surface to balance the pH. Feed used coffee grounds sparingly, as they add to the acidity. A bin between 15 and 25 °C (59–77 °F) suits the worms and lets them clear the food before the flies can.
How do I build a low-cost fruit fly trap?
- Take a large, empty plastic soda bottle and cut off the top just where the round shoulder turns into the straight side.
- With a sharp nail or scissors, punch 5 or 6 small holes of 2–3 mm about 10 cm / 4 in above the bottom.
- Put a few banana skins into the bottle.
- Turn the cut-off top upside down and push it into the opening like a funnel. Make sure it fits tightly, and seal it with clear sticky tape.
- Place the trap a few metres from the worm farm, on something raised.
Then open the worm bin, shoo out as many flies as you can and close it again. The flies follow the smell of the banana into the trap and most can’t find their way out. You should catch most of them within 48 hours. Set the trap again if needed, then feed the dead flies to your worms.



I already have a swarm. What now?
First, take out the worst pocket of fermenting fruit along with its maggots. Bury whatever fruit is left and cover the surface. Stop adding fruit for a week, and set two or three traps. If the bin is wet, mix in dry cardboard. Within a few days the numbers drop sharply.
What about fungus gnats?
Fungus gnats are black, slender and look like tiny mosquitoes. They’re attracted to fungi and moisture. Let the surface dry out a little, but remember that the worms still need moist bedding, and cut back on feeding. We’ve never had a big problem with gnats and usually just ignore them.
Happy worming!
Stephan Kloppert
Nearly 30 years of worm farming in South Africa and Germany
Running your worm farm as a business? How to Start a Profitable Worm Business on a Shoestring Budget shows you the way.


