It can be frustrating to deal with fruit flies in compost piles. These easy tricks will substantially reduce their population.
Fruit flies in compost – ick!
I have to admit, when I first started composting, I was horrified to find bugs in my pile. I didn’t want earwigs and sow bugs in there! What I didn’t realize is that those bugs were all a part of the decomposition process. Some bugs commonly found in compost actually feed on the decaying matter, while some feed on other bugs.
Nematodes, mites, snails, slugs, earthworms, millipedes, and sow bugs are the primary consumers of the organic matter in a compost pile.
This post may contain affiliate links; I'll earn a small commission if you choose to make a purchase.
The bigger bugs in the pile – centipedes and beetles, say – are secondary or tertiary consumers, meaning that while they’re not technically helping break down the compost, by eating those primary consumers they are part of the life cycle there.
Reader Favorites from Attainable Sustainable
(Check out the compost food chain that’s shown on this page about invertebrates in the compost pile if you’re really interested in the science of your compost heap.)
How to get rid of fruit flies
Much as I understand now that bugs are just part of the process, I really don’t like the fruit flies that populate my compost pile. When their population is out of control, they fly up in a cloud of wings every time I toss something new on the pile, seemingly intent on making their way into my nose.
And it’s not just that. Fruit flies can wreak havoc in the garden. The females lay their eggs just under the skin of soft fruit. There’s nothing worse than cutting into a tomato to find little squiggly maggots. Well, I take that back. Worse is biting into a piece of fruit to find little squiggly maggots.
Figuring out how to get rid of fruit flies once they’ve taken over the pile is harder than simply preventing the problem in the first place, so I do my best to keep the problem in check. [Read about getting read of fruit flies in the kitchen here.]
Preventing fruit flies in compost
I find that the best way to prevent an overabundance of fruit flies is to make it harder for them to get to the material they like. They’re after the kitchen cast offs, not the dry leaves and grass clippings. I try to maintain a layer of undesirable materials at the top of the pile. When I add food scraps to the compost, I lift this layer and tuck the kitchen waste below it. [More about the basics of composting here.]
Related: 7 Organic Pest Control Methods
How to get rid of fruit flies by adjusting your compost balance
If you’re finding that your pile is really infested with fruit flies, it’s likely that your pile needs more carbon. Add dry leaves, straw, or shredded newspaper to create a higher ratio of carbon to nitrogen.
Consider fruit fly traps
Fruit fly traps hung above or near the compost pile will attract the flies and prevent them from reproducing. I have one that I made out of a plastic bottle (kind of like this) with a lure inside and it attracts a fair amount of flies. I’ve also had success with banana peels and wine as an attractant.
Uncover your compost pile
When I’ve kept lidded compost bins, the fruit flies seemed to be worse. Maybe because the flies are trapped inside where they lay more eggs, multiplying quickly? I honestly don’t know, but I don’t keep a lid on my compost any more. (Remember, we don’t have much in the way of compost raiding critters here, so I can get away with this.)
This is more about prevention than how to get rid of fruit flies, of course.
Related: Natural Pest Control in The Garden
A hot compost pile will prevent the larval stage of fruit flies (maggots) from surviving in all but the outer (cooler) areas of the pile. If you’ve got a hot compost pile I’d be curious to know if fruit flies are an issue for you.
Do you have any other tricks for taming the fruit flies in compost? Please share!
Originally published June 2011; this post has been updated.