How to Get Rid of Flies in Compost


According to the University of California Cooperative Extension, flies introduce fresh bacteria to your compost, which assists in faster waste decomposition. However, flies certainly don't play a Good Samaritan role in your compost pile; they're after smelly decomposing waste, such as food scraps and cow manure, and before you know it, they can get out of hand, especially if you don't maintain your compost regularly. Multiple fly species, including soldier flies, horse flies, houseflies and fruit flies, may inhabit your compost at any time in the form of eggs, larvae (maggots) and adults. Focus your efforts on proper compost maintenance and you should see a marked decrease in flies.

Step 1

Aerate your compost to increase microbial activity from oxygen-loving bacteria. Scoop the waste from the center of the pile or bin, shifting it to the outside edges with a manure fork. Gather waste from the edges of the heap and move it to the center of your pile. Repeat this aeration process at least once weekly to ensure adequate microbial activity.

Step 2

Inspect your compost for fly larvae in the form of wriggling, white or gray maggots of various sizes. Don a pair of rubber gloves and pick up any maggots that you find. Gather them in a plastic cup or bucket. Dump them out on the bare ground or in a bird feeder to provide your birds with a tasty snack. Repeat this process until you no longer see any fly larvae in your compost.

Step 3

Squeeze a handful of compost waste to check the moisture level of your decomposing compost; if you can wring out more than two drops of liquid, then you've got a moisture problem. Add carbon-rich waste, such as straw, sawdust or shredded newspaper to your pile or bin. Shift the fresh waste into the center of the compost to soak up the extra moisture and discourage smelly, fly-attracting, anaerobic decomposition.

Step 4

Add only mild food scraps, such as fruit peels, old vegetables and dried bread, to your compost. Avoid smelly foods, such as bones, meat and dairy products, which attract flies in droves. Bury all food scraps beneath 3 to 4 inches of carbon-rich waste, such as sawdust, which limits odors and keep the flies from laying eggs on it.

Step 5

Sprinkle grass clippings or freshly cut hay on your compost to provide most of the nitrogen content. Try not to use fresh manure in your compost, since it provides a common location for fly eggs.

Tips and Warnings

  • Never use manure from meat-eating animals, such as pets, in your compost, since it could contain harmful pathogens that may infect humans.

Things You'll Need

  • Manure fork
  • Rubber gloves
  • Plastic cup/bucket
  • Carbon-rich organic waste
  • Grass clippings/freshly cut hay


  • University of California Cooperative Extension: Big Maggots in Your Compost? (pdf)
  • "The Complete Compost Gardening Guide"; Barbara Pleasant & Deborah Martin; 2008
  • University of Illinois Cooperative Extension: The Science of Composting
Keywords: flies in compost, compost problems, maggots in compost

About this Author

Regan Hennessy has been writing professionally for 11 years. A freelance copywriter and certified teacher, Hennessy specializes in the areas of parenting, health, education, agriculture and personal finance. During her time with Demand Studios, Hennessy has produced content for Ehow, Answerbag and Travels. Hennessy graduated from Lycoming College with a Bachelor of Arts degree in English.