How to Get Rid of Flies in Your Compost Pile

//

Robby

I hate fruit flies! I never really saw any until I started composting without looking much into composting. I just bought a black Dalek style bin and started adding in all of my fruit and veg scraps, along with grass clippings and any prunings I had.

I had a kitchen compost caddy to put the food waste into each mealtime, and when it was full, I emptied it into the compost bin at the end of my small garden.

Remembering back, it must have been the Autumn/Winter when I bought the compost bin and the first summer where I met the fruit flies. They were attracted to my kitchen caddy, which was on my often open kitchen window. The caddy was not locked closed, so there was clear access for the flies. So, I spent my evenings battling, trying to catch and remove the fruit flies.

Having flies buzzing around your compost is an annoying problem that many gardeners face. While flies are natural composters, an overabundance of them means your compost has become unbalanced The good news is that with a few simple strategies, you can get rid of compost flies and prevent them from coming back.

Why Do Flies Gather Around Compost?

Flies are attracted to compost piles because they provide ideal conditions for breeding and feeding Compost offers flies

  • Food. Flies eat decaying organic matter and thrive on the microscopic organisms that live in compost.

  • Moisture. Compost piles contain moisture that flies need to lay their eggs and survive.

  • Warmth. The heat generated by the decomposition process creates a cozy environment for flies.

  • Shelter. The nooks and crannies of a compost pile provide shelter for flies to safely lay eggs.

What Types of Flies Infest Compost Piles?

There are three main flies that are attracted to compost:

Fruit Flies

Fruit flies are tiny flies, about 1⁄8 inch long. They lay their eggs near the surface of the compost. Their larvae feed on fungi, yeasts, and bacteria.

House Flies

The common house fly is about 1⁄4 inch long. House flies lay eggs deep in the compost where it’s warm. Their larvae (maggots) eat decaying organic matter.

Blow Flies

These larger flies are metallic blue or green in color and are about 1⁄3 inch long. Blow flies lay eggs on fresh grass clippings or food waste. The larvae feed on decaying matter.

How to Get Rid of Compost Flies

Here are the top methods to eliminate flies and keep them away from your compost:

1. Keep Your Compost Balanced

Flies are naturally attracted to compost, but an excess of flies indicates your compost is out of balance. The best way to control flies is to maintain a proper balance of greens (nitrogen) and browns (carbon).

  • Greens – Fresh green material like grass clippings, fruit and vegetable scraps provide nitrogen. Don’t add too many at once.
  • Browns – Dried leaves, wood chips, straw, and paper provide carbon. Balance the additional greens with additional browns.

This ratio of greens to browns should be around 30:1. Monitor the balance and make adjustments as needed.

2. Turn the Compost Pile

Turning or stirring the compost introduces air and redistributes moisture. This makes the environment less hospitable to flies.

Use a compost turner or a pitchfork to turn over and mix up all the materials in your compost pile. Do this weekly or bi-weekly to control flies.

Turning also speeds decomposition, lets you check moisture levels, and mixes the materials so they break down evenly.

3. Keep the Compost Moist

Flies need moist conditions to breed, so aim to keep your compost moist but not soggy. Use a compost moisture probe to check the moisture level, which should be around 40-60%.

If the pile is too dry, add water or “green” materials like food scraps. If it’s too wet, add more “brown” materials like leaves to soak up excess moisture. Proper moisture will encourage beneficial microbes and deter flies.

4. Manage Food Waste Carefully

Flies are highly attracted to fresh food waste. Here are some tips for handling food scraps:

  • Bury food waste under 10 inches of compost so flies can’t access it.

  • Don’t put meat, fish, or dairy products in your compost, as these are most attractive to flies.

  • Keep a sealed container for collecting food scraps, and add them to an established pile, not a new one.

  • Mix in yard waste like dried leaves after adding food waste to balance the nitrogen.

5. Use Diatomaceous Earth or Insecticidal Dust

Sprinkle a thin layer of diatomaceous earth or insecticidal dust on top of the compost. These abrasive dusts will cut up and desiccate any flies that land on the pile.

Reapply after turning the pile or heavy rain. Wear a mask when handling these dusts. Diatomaceous earth is non-toxic to humans.

6. Install Fly Paper or Tape

Sticky fly paper or tape traps flies when they land on the compost pile. Hang strips around the compost area.

Replace strips frequently as they fill up with dead flies. This won’t eliminate the source but helps control the fly population.

7. Introduce Fly Predators

Release beneficial insects that prey on compost flies:

  • Parasitoid wasps – They lay eggs inside fly larvae and pupae. The wasp larvae kill their fly hosts.

  • Dragonflies – Both adults and nymphs are voracious predators of flies. Attract them with water features.

  • Venus flytraps – These carnivorous plants capture and digest flies. Keep potted flytraps near your compost.

  • Frogs & lizards – Encourage these insect-loving animals in your garden to eat adult flies.

8. Use a Compost Bin

An enclosed compost bin is less accessible to egg-laying flies than open piles. Bins also retain heat and moisture better.

Get a bin with tight-fitting lid and small openings that allow air circulation while keeping flies out.

9. Trap Flies in a Bottle

This easy trap lures flies in but prevents escape:

  • Cut the top third off a plastic soda bottle.

  • Invert the top part and insert it into the bottom section to create a funnel.

  • Add a small amount of rotten fruit or compost as bait.

  • Position traps along the ground around the compost pile.

10. Protect the Pile with Landscaping Fabric

Cover the top and sides of the pile with breathable landscaping fabric. Secure the fabric with stakes or rocks.

The fabric allows air flow but forms a physical barrier to keep flies off the compost. Lift to access the pile and re-cover after.

When to Take Further Action

With proper compost maintenance, the methods above should eliminate most compost flies.

But if you still have persistent, heavy fly infestations, you may need to:

  • Remove and dispose of seriously infested material.

  • Start a new compost pile in a new location.

  • Consider switching from open piles to a fully enclosed composting unit.

  • As a last resort, use insecticidal sprays derived from pyrethrins as directed. Avoid broad-spectrum insecticides.

Getting rid of compost flies may take some patience and work. But with a little diligent effort, you can have a thriving, insect-free compost pile.

Frequently Asked Questions About Compost Flies

What are those tiny flies swarming my compost?

They are probably small fungus gnats or fruit flies. They indicate your compost is too wet and needs more brown matter added.

Why do compost flies come back after I think I’ve gotten rid of them?

Flies reproduce rapidly, so there are probably eggs and larvae still in the compost. Keep using prevention methods, and don’t add any food waste until the problem is fully gone.

Are compost flies harmful?

While annoying, compost flies are not directly harmful to human health. They help break down organic matter. But an overabundance stresses the compost ecosystem.

How do compost flies find my pile so fast?

Flies can detect the gases emitted during decomposition from impressive distances. Maintaining a balanced pile will produce fewer attractive odors.

Should I use a compost tumbler instead of an open pile?

Tumblers make it harder for flies to access the compost, but they won’t fully prevent flies in balanced, well-managed piles. Leaving the pile exposed fosters beneficial insect habitat.

How can I safely add food scraps if they attract flies?

Bury food waste deep in the center of an established compost pile and cover with browns. Don’t put meat, fish, or dairy products in compost.

When should I consider getting rid of my whole compost pile?

If you have persistent heavy infestations even after aggressively using prevention methods, removing the pile entirely may be needed to fully disrupt the fly lifecycle.

Why use beneficial insects instead of pesticides for compost flies?

Introducing predators like wasps creates a balanced ecosystem. Pesticides disrupt habitats for pollinators and other beneficial species and may directly kill worms and insects in the compost.

how to get rid of flies in compost

So, what I have learnt about how to combat this problem now.

1. Bury the fruit and veg

You can bury the food waste that flies are attracted to in the middle of your compost bin, with other material above and to the side.

This approach means getting a bit hands-on with your compost and making sure the food waste is not accessible. Its not easy, as you need a lot of brown non-food waste to cover. There is also no guarantee that you will cover the waste and the flies will not access it!

2. Lasagne approach

Similar to the first solution; however, this is a more organised way of layering your waste.

The idea is that you add your layer of food waste first, and when that is added, you add a layer of brown waste over the top. Brown waste can comprise shredded paper, cardboard, twigs, wood. You will need a good 2-4 inches.

Read my guide on Balancing Your Green And Brown Waste In Your Compost

In practice, you need to keep a stash of brown waste close to your compost bin. I rip up all of the cardboard boxes we get and all of the waste paper we use for the kids crafts and the cardboard loo rolls!

It would be best to have a sealed container for your food waste until you are ready to add a full layer. However, you can add a small amount and cover it with the required brown material.

3. Fully sealed compost bins

Hotbins are fully sealed hot composters that will not let in any unwanted guests. They tend to be on the pricey side. When you consider the standard benefits of a hotbin, like getting compost in just 30-90 days and being able to compost pretty much all food waste and have no fruit flies – its a justified investment for gardeners and those looking to reduce their food waste heavily.

Bokashi bins are also fully sealed, and you can put all your food waste too. You can read more about Bokashi composting here.

how to get rid of flies in compost

FLIES IN YOUR COMPOST?

Leave a Comment