Skip to Content

What Attracts Flies In Compost + How To Get Rid Of Them

What Attracts Flies In Compost + How To Get Rid Of Them

Sharing is caring!

I think we can all agree that having flies flying around your home is really annoying! However, it gets much worse when you have a compost pile or compost bin in the garden. These little annoyances are the reasons many gardeners don’t want to start making their own compost, even though it is an effective way to provide fruits and veggies with nutrients.

The most common critters are fruit flies, vinegar flies, house flies, or soldier flies, and they like to buzz around your compost to try and steal some food. Although some good bugs and maggots are necessary for the decomposition process, the flies mentioned above are simply intruders.

Luckily, there are some ways that you can deter these creatures and have fly-free compost. If you want to start composting your kitchen scraps, but are worried about flies, keep reading to learn easy solutions!

How To Identify Flies In Compost

Since compost is made of kitchen scraps, food waste, spoiled fruits, veggies, and manure, it is logical that you will spot some little flies around your compost. However, if you don’t make your compost pile or bin in the right way, you might end up with a huge fly problem.

Now, there are still some insects that are necessary to decompose waste, but there are usually several fly species that don’t have any role or function and are simply there to use the compost as a food source.

It is important that you are able to identify the bad insects from the good ones that would otherwise ruin your compost heaps. The bad guys include:

Fruit fliesthey are tiny, oval-shaped flies that only reach an adult length of 1/8 of an inch. Fruit flies typically appear tan overall, despite having a tan thorax and a black abdomen with a gray underbelly. Although some can have eyes of a different color, fruit flies frequently have red eyes. These flies are attracted to fruit in the first place, which is the key difference between them and vinegar flies.

Vinegar flies — they are about 1/8 of an inch long, brownish-yellow in hue, and with recognizable red eyes. Females can lay up to 500 eggs in the skins of fruits and vegetables. The fly’s life cycle from egg to adult can take as little as one week under the correct circumstances, although it often takes 9 to 12 days. They are attracted to fermented juice and yeast rather than rotting fruit.

House flies — the female house fly is often larger than the male, and it ranges in length from 5 to 7 mm. Reddish eyes and sponging mouths are visible on its head. Four little black stripes may be seen on the thorax, and the fourth longitudinal wing vein has a sharp upward bend. They are usually attracted to food scraps, so burying them deeply might prevent an infestation.

Having one or two flies around your compost pile is pretty normal. However, the issue arises when they lay eggs, especially because the conditions are ideal for their further growth and development.

For instance, fruit flies absolutely love warm and moist environments, so your compost will be crawling with tiny larvae feeding on the organic matter within before you know it. We already mentioned that they can lay up to 500 eggs, so imagine how many of them will grow and develop!

Although they can eat decaying fruits and veggies to ultimately produce nutrient-rich fertilizers, these flies should still be controlled and prevented from entering your home/compost. Don’t mistake them for plant flies or fungus gnats, as these little guys love to come inside and check out your plant collection.

If you are having issues with a plant fly infestation, then check out this handy article: How To Get Rid Of Plant Flies: 8 Effective Methods

The Good Insects

One of the good guys is the soldier fly. Adult flies are black or blue in color and resemble wasps in appearance. Two transparent “windows” can be found on the first abdominal segment of soldier flies, and adults are between 15 and 20 mm long.

Introducing soldier fly larvae is one of the best methods to make fast compost — they are resistant to hot temperatures (good for hot composting), and they can decompose dairy products and meat. Adult flies don’t carry diseases and they live relatively short lives.

They are also great for worm bins because they don’t eat the worms.

You see that not all insects are bad! Even though soldier flies look scary, they can accelerate the decomposition process to make nutrients faster.

How To Get Rid Of Flies In Compost

Creating a good compost can sometimes be difficult, especially if you don’t follow the instructions carefully. Sure, having random flies flying around the garden seems normal, but the issue arises when you have an army of annoying flies buzzing around.

So, how do you get rid of them? Do you get rid of the entire compost pile and start creating a new one, or are there other ways that you can get rid of these annoyances?

Luckily, you don’t have to start the whole process from the beginning. You can simply add some stuff to make them leave on their own.

Let’s dig in!

1. Add More Brown Material

Compost consists of green and brown materials. Nitrogen-rich organic materials such as apple cores and banana peels make up the greens, while materials like tea bags and coffee grounds make up the brown part.

Brown materials also include pine needles, dried leaves, and little wooden branches, and they are all things that decompose swiftly.

Another great choice is shredded cardboard and paper. You should be aware that, in this instance, the decomposition rate is slower.

These two items should be torn or shredded as much as possible to speed up the process of decomposition.

Other ingredients follow the same rule: the smaller they are, the quicker they compost.

Just a friendly reminder that the majority of greeting cards, flyers, catalogs, and wrapping paper are made of laminated materials that cannot biodegrade. 

Always put kitchen waste in your compost pile as it will enrich it greatly.

The following are some examples of wastes that make excellent compost:

• Food leftovers, such as raw fruit and vegetables (peelings also)

• Tea bags

• Spices and herbs

• Coffee grounds

• Shelled eggs

• Older wines

Other environmentally friendly materials, such as grass clippings, can also be utilized. With grass clippings, there is one disclaimer: the layer shouldn’t be any thicker than 20 cm, or it will take an eternity to decompose.

Besides, you can use these grass clippings as mulch!

The use of garden waste such as green vegetables is permitted, but only in the absence of herbicides.

2. Avoid Adding More Materials

If you keep adding more organic materials to compost infested with flies, then you will probably end up feeding them even more. Therefore, you should avoid adding specific materials if you want to get rid of flies in compost.

The use of cooked food will only result in mulch that’s too wet. Additionally, when cooked food is added to homemade compost, the smell is very unpleasant. All your attempts will be ineffective because this stench frequently attracts a lot of pests.

Other organic materials may have an impact on the helpful bacteria in a compost pile. In addition to avocado and fruit stones, these components also contain dairy and animal products.

Infected plants are the worst thing to put in a compost pile.

You don’t want pet waste or coal ash in your homemade compost either, and you also don’t want certain inorganic items like metal, plastic, or glass.

3. Fly Traps

I am going to mention the most common traps that are being used, especially because some little flies can enter your home as well. Most traps are fruit fly traps, as it seems like there are always some annoying flies around fruit bowls!

Now, you can either use some DIY traps that are just as effective as store-bought ones, or you can simply go to your local garden shop and buy some fly traps.

Let’s take a closer look.

Vinegar Traps

Making vinegar traps is a gardening technique that can be done at home (that is the essence of gardening). It won’t take long to create this simple and effective fly trap, so your garden will be fly-free in no time!

It only requires adding a few drops of dish soap and some white vinegar to a shallow container. Dish soap is required to break the surface tension. Place this container next to the damaged plant, and keep doing this until no more gnats are present.

You can also add a few drops of dish soap and combine apple cider vinegar with fruit juice, beer, or both. To hasten the process, you could also include a banana or another piece of fruit. The fruit will climb to the surface of the liquid, which will draw flies even more quickly. Your trap is finished once you cover the top of the glass or container with plastic wrap and make some holes with a toothpick.

Fruit Traps

You can use a piece of overripe fruit to catch these pesky flies instead of throwing it on the pile. Overripe fruit only needs to be placed in a bowl, covered with plastic wrap, and punctured.

They won’t be able to escape and the flies will buzz down to reach the fruit.


A flycatcher is a tool for catching flies indoors. They can be bought locally or on Amazon, and are normally USB-powered. Gnats are drawn to the fans and LED lights, and then killed by the trap.

4. Let The Compost Breathe

Oxygen is necessary for the microbes needed for healthy compost. You can turn the compost pile once a week to make sure they get enough oxygen.

Using a compost aerator is the simplest approach to guaranteeing that compost receives the oxygen-producing bacteria it needs.

Pitchfork stirring is the traditional method for increasing aeration. Simply fold the mixture in.

Don’t discard any cardboard products, including egg cartons and wood chips. They can be torn up and added to the compost to increase aeration.

Remember that creating new compost requires time, but only if you ignore all the instructions. You can quickly produce high-quality compost if you add enough compostable materials.

Aeration may aid with raising the pH a bit, so do this instead of adding baking soda or lime.

5. Frozen Waste

Before you put food waste into your compost bin, it is important that you store them properly and keep them fly-free. If your waste is already infested with flies, especially eggs and larvae, then it is most likely that they will spread all over your pile.

However, there is an easy way to prevent this from happening. All you have to do is put these scrapes in a plastic bag and let them freeze overnight. The little bugs can’t stand such low temperatures.

6. Wrap Up

You can also use butcher paper or some newspaper to wrap up the organic materials. Flies won’t be drawn in by the fragrances as much because of the paper, and even if they do, they won’t be able to access the waste. Together with the scraps, the paper will dissolve.

7. Seal The Composter

Although you can seal compost bin openings to keep fruit flies out, and cover compost bin vents with mosquito netting, compost needs air to decompose. This permits ventilation but keeps flies from entering.

8. Add Essential Oil

You can add essential oils to avoid unpleasant odors and deter these annoying creatures. For a quicker result, use peppermint, eucalyptus, lemongrass, or lavender essential oils. A few drops wiped on potential entry points to the compost container will deter flies. To keep them at bay, use these essential oils for your house as well.

Frequently Asked Questions

1. Is it OK to have flies in compost?

It is okay to have some flies flying around your compost pile, but issues arise when there is an army of flies hovering all over your garden and entering your house. This might be a sign that you are dealing with an infestation. It is also important to distinguish between good and bad insects since they are crucial in the decomposition process.

If you see numerous fruit flies, vinegar flies, or house flies around your compost, then you are probably dealing with a fly infestation. However, if you spot tons of soldier flies, then your compost is going to be top-notch!

2. What is the best way to get rid of flies in compost?

The best way to get rid of flies in compost is to add more brown materials. Add things such as coffee grounds, leaves, tea bags, and some pine needles above the green materials, which should be buried deep down.

Avoid adding more organic stuff, as it would just make more food for the flies.

You can also use fly traps to try and catch as many of them as you can. For instance, vinegar traps are very easy to make and they get the job done.

Ensure that the compost is well-aerated, and add some essential oils to make it smell nice. There are some other tricks that you can use to prevent flies from entering your compost — freeze the kitchen waste before adding it to compost or wrap it to prevent the smell that attracts flies from spreading.

3. Why do flies like compost so much?

Well, the answer is pretty much the same as for your plants — they use it as a food source. They like organic materials, especially fruit flies with rotting fruits. Therefore, it is important that you mix the brown and green materials perfectly.

Well, the answer is pretty much the same as for your plants — they use it as a food source. They like organic materials, especially fruit flies with rotting fruits. Therefore, it is important that you mix the brown and green materials perfectly.

To Sum Up

Noticing flies in compost is really annoying, especially when they start flying all over the garden and into your home. But who can blame them when you make such delicious and nutrient-rich compost?

While it is a good thing to have some flies in your compost for the decomposition process, it is important to identify the bad critters from the beneficial ones. Soldier flies with large, dark bodies are friends, while the other smaller brownish ones are foes.

Though it might be troubling to get rid of these annoyances, if you follow the tips mentioned above, I’m sure that you will be able to make them go away.

I hope this article was helpful.

Until next time!

Like this post? Share or pin it for later!