This post may contain affiliate links. I may receive commissions for purchases made through links in this post.

How To Troubleshoot Flies In Compost

You’ve got your compost system all set up. You’ve been adding all the right things. And then boom- an invasion of flies and maggots ruins your composting dreams.

Don’t let flies and maggots scare you off from composting!

Many flies and maggots are beneficial to compost. Keep reading to figure out how to troubleshoot the bothersome flies and how to keep the beneficial maggots working for you.

Should there be flies in your compost?

The quick answer is yes and no.

The complicated answer is that certain types of maggots and flies play a very important role in the decomposition process. Good bugs do great things for compost. They aerate the pile, warm up the pile, and their excretions are nutrient rich. Basically, good bugs can do half of the compost work for you! 

So, how do you know if you need to troubleshoot flies in your compost bin?

If your compost bin is overrun by any type of flies or maggots, then you need to do some troubleshooting.

If you have the occasional fly or see a few maggots here and there, you don’t need to do any troubleshooting.


The different types of flies that populate compost bins

There are four common species of flies that love compost- vinegar flies, fruit flies, house flies and soldier flies.

House flies are on the list of “bad bugs for compost”, while soldier flies are on the list of “good bugs for compost”. So how can you tell them apart? 

Vinegar flies & Fruit flies

Vinegar flies are the tiny little flies that are attracted to fermented juices from rotting fruit. 

Fruit flies are very similar to vinegar flies with the main difference that they feed directly off fruit, not the rotting fermented juices. 

Both are relatively harmless and can be eliminated in the house with a fruit fly trap

House flies

House flies are disgusting little creatures that carry disease due to the hairs on their legs. These are the type of flies and maggots that you want to keep out of your compost bin.

One or two isn’t a problem. It’s the infestation that you want to avoid. To keep house flies out of your pile, simply bury your food scraps further down in your compost pile or cover with a brown material.

House flies maggots are the typical looking white maggots that you’ve probably seen invading trash cans. If you see these, then it’s time to troubleshoot!

Soldier flies

Soldier flies are the most beneficial to your compost pile, but also the scariest looking of all flies. 

Soldier flies look very similar to wasps. The maggots are large, brown, scaly things that could easily make the least squeamish person wonder what kind of creature has invaded their compost bin. 

While these things look disgusting, the maggots are known to break down organic material well. Not only that, they inoculate the compost with beneficial bacteria. 

Soldier fly maggots work well with worm bins because they don’t eat the worms and vice versa. A worm bin with a healthy population of soldier fly larva is one of the most productive way to compost.

The adult flies only live for 2 days and don’t carry disease. 

The only problem is when you get an infestation of soldier flies. Even though soldier flies are beneficial, an infestation is still a nuisance. 

If you see a few of these scaly maggots in your bin, let them stay! It’s not time to troubleshoot yet.

How to avoid an infestation of flies in compost

The best way to avoid an infestation of flies is to properly compost with a ratio of 2:1 green material to brown material. 

This means that for every layer of food waste that is high in green/ nitrogen rich materials, you should add at least half as much brown/ carbon rich material on top. 

The top layer of brown/ carbon rich material is key. Flies love to eat food. They are attracted to any food. If you cover it up with a layer of brown material (leaf litter, paper bags, newspaper) then the flies will not be attracted in the first place.

What happens if you still get an infestation of flies?

It happens!

Even the best compost experts have problems with flies from time to time.

When this happens, it is time to bring out the big guns and get rid of the flies.

How to get rid of flies and maggots in compost

Add more browns

The easiest solution is to simply add more brown material on top. Always do this first.

Stop adding to pile/bin

If you can’t get rid of the flies and maggots, stop feeding them. Keep adding more brown material until you’ve completely cut off the food source. Start a new bin and let the other compost bin rest for a while. If you have a pile that can be turned easily, turn it. If you have a tumber, turn it.

Lime the compost

Try raising the pH level of your compost. You can do this by adding 1 C of lime to 25 cu. ft. of compost, pine needles, or citrus peels. 

Doing this may raise the pH too high for your plants. Make sure to either test for pH with a tester or only use on plants that like acidic soil.

Remove the larvae

Simply take the top off your bin and let the birds go to town. Birds love maggots. If you let them have access to them, they will go wild.

You can also shovel them out so the birds eat only the larvae and not your food scraps.

troubleshoot flies in compost

How to get rid of black soldier fly larvae in worm bins

I want to specifically address black soldier fly larvae in worm bins because this is a common problem here in SWFL.

If your worm bin has holes that are too large, it is possible that you are inviting black soldier flies to dinner.

You can avoid them by making your holes at the top of your worm bin 1/16 inch. This is big enough to allow oxygen to flow without being large enough for flies to go inside.

We have personally had issues with black soldier flies in our worm bins (learn how to make your own worm bins here). In order to combat them, we followed all the steps above and when that didn’t work we converted our worm bin to a bokashi bin, let it ferment for 2 weeks, and then added worms back into the mix.

This solution yielded the best compost we’ve ever made. In fact, we loved it so much that we now have a rotation of bokashi compost to worm bin going at all times!

Like this post?

Don’t forget to follow us on social media (Facebook, Instagram, and Twitter) to see more of what we love. If you like this post, you’ll love our social media accounts too! Want to know another way you can see more of what I love? Follow us on Pinterest.  We’d also love for you to pin this post to Pinterest if you liked it!