How to get rid of compost flies

Compost flies
Compost flies breed rapidly and can quickly become a nuisance if conditions allow.

In the world of composting, not all bugs are bad news. Your compost pile is a bustling ecosystem, home to a variety of critters like nematodes, mites, snails, slugs, earthworms, millipedes, and woodlice, all playing vital roles in breaking down organic matter. However, when you find yourself greeted by a cloud of flies in your compost with every toss of kitchen scraps, it's clear there's an imbalance. Compost flies have a nasty habit of laying eggs under the skin of soft fruits, turning your composting efforts into a breeding ground for garden pests.

Why compost flies are more than just a nuisance

Fruit flies, or vinegar flies, thrive in warm, damp environments. Their presence in your compost pile can signal a significant imbalance in your compost ecosystem. An overabundance of kitchen scraps or excessive moisture not only attracts these pests but can also disrupt the composting process. It's a sign that your compost might be too wet and/or overly rich in nitrogen-rich "greens". This slows the composting process by turning the pile anaerobic (reducing its oxygen content), simultaneously creating an ideal breeding ground for fruit flies and their larvae.

Ten strategies for dealing with compost flies

Winning the war against compost flies requires a multi-faceted strategy. Here's how to make your compost pile inhospitable to these unwelcome guests:
  1. Sun and air: Flies prefer shade and moisture to breed. Position your compost in a sunny, well-ventilated area to deter them.

  2. Balance and aerate: A 2:1 ratio of brown to green materials ensures your compost is not too moist or nitrogen-heavy, discouraging fly breeding. Regularly turn your compost to aerate it and bury food waste under brown materials (e.g., dry leaves, garden prunings, straw, newspaper, and cardboard) using a lasagne layering technique.

    Covering food waste in compost bin using lasagne layering technique
    Burying food waste will help deter compost flies.
  3. Dry top layer: Keep the top 2-3cm of your compost dry to create a barrier against the wet compost below, making it less appealing to flies.

  4. Sealed containers: Consider a fully sealed compost bin system like hotbins, bokashi bins, or wormeries to keep scraps contained and inaccessible to fruit flies.

  5. Hot composting: Achieving higher temperatures in your compost not only prevents larval stage fruit flies (maggots) from hatching, but also accelerates decomposition, denying flies their food source.

  6. Composting worms: Introduce composting worms (e.g., brandling, red, or tiger worms) to your pile. They're not only efficient at breaking down organic matter but also consume fly larvae.

    Composting worms
    Adding composting worms will increase the rate of decomposition, reducing the amount of food available for compost fly larvae.
  7. Freeze scraps: Freezing kitchen scraps before adding them to the compost can kill any pre-existing fly eggs and reduce odours that attract flies.

  8. Homemade traps: Set up fly traps using apple cider vinegar, banana peels, or even wine as bait. These attract and capture adult flies, preventing reproduction. Vinegar traps with a soap mixture can help break the surface tension, ensuring flies that land cannot escape.

  9. Diatomaceous earth: This natural insecticide cuts through flies and larvae, causing them to dehydrate and die. Sprinkle it atop your compost for an effective deterrent.

  10. Natural repellents: Utilise essential oils, cedarwood, or fly-repelling plants like basil, mint, and rosemary around your compost area. Spices like cayenne pepper also work as irritants to keep flies at bay.

    Homemade compost fly trap using jar and paper funnel
    A jar with a paper funnel or cling film lid makes an excellent homemade trap. Secure the cling film with a rubber band and poke tiny holes in it with a toothpick so flies can get in but not out.

By implementing these strategies, you can restore balance to your compost pile, ensuring it remains a productive part of your garden without becoming a fly haven. Remember, composting is an art and a science—requiring observation, adjustment, and a bit of patience. Here's to a flourishing garden and a fly-free composting experience!