How To Keep Fruit Flies Away From Your Compost

Our experienced writers spend hours deep researching, considering both scientific and experimental info to bring the insights you can trust.  

In Brief: How To Keep Fruit Flies Away From Your Compost

Are fruit flies infesting your compost? They can be quite irritating and frustrating to deal with, even though they do not cause any damage to your compost pile. Luckily, there are a few things you can do to discourage fruit flies from settling in to your compost pile. In this article, we will look at some of the methods and tricks you can use to get rid of them.

Creating your own compost takes some effort, but it is well worth it. However, you sometimes get an unwanted guest – fruit flies.

Fruit flies are attracted to the fermenting compost, and with time, they can attract thousands of them to your compost.

Even though they don’t bite or cause harm to the compost, some of them may get into your home and go after your fruit bowl.

Keeping Fruit Flies Out Of Your Compost

How do you get rid of these insects? The following are some strategies you can use to attempt to protect your compost.

Fruit flies are attracted to decomposing vegetables and fruits, so you could add more brown to your compost to dry it out. This will discourage the fruit flies. ‘Browns’ include sawdust, cardboard, unprinted paper, or fabrics.

Fruit flies are not interested in brown materials, so you could cover up your compost with them.

You can still balance out your ‘green’ to ‘brown’ ratio, just keep the green at the bottom and make your top layer brown.

If your compost is well balanced, you could try using traps. The fastest way to trap them is by using a common household tool – the vacuum cleaner.

Turn it on and aim it at the insects. This will kill the insects. You can do it for the next couple of days until they reduce in number.

However, as you do this, you must remember to be cautious not to vacuum worms or scraps of your compost. You could also set up traps to get the faster fruit flies.

They are available in most grocery stores.

To make your own fruit fly trap, check out this youtube video:


You could also take precautions with your compost materials. Since fruit flies are attracted to fruits and vegetables, you could wrap them up before adding them to your compost pile.

This makes them less accessible to not the fruit flies and other pests. You can use butcher paper to wrap them up.

Boiling the kitchen refuse is also another way to keep the fruit flies away, as this makes the area less attractive to insects.

If you are using an enclosed compost bin, you might think that closing the lid on the bin will keep fruit flies away.

However, this can lead to an increased fruit fly population in your bin, as fruit flies that may have been trapped inside will lay more eggs and multiply much faster.

Even though this is not the case for many gardeners, some claim it is true. Some gardeners are successful in keeping fruit flies away by closing the lid, yet for others, closing them did not stop the fruit fly infestation.

You should try and find out which one will work for you – lid or no lid.

If the above methods do not work for you, try the hot compost method. Hot compost is bad for the fruit flies, as it harms their eggs.

You can achieve this by pouring boiled water on your compost repeatedly. This method is also reported to have killed live fruit flies, as well.

If you have an enclosed compost bin, this method will be more effective for you. Shut the lid immediately after you pour the hot water to trap the insects with heat.

You could also splash hot water on the top and sides of your bin outside.


Fruit flies are a nuisance to compost, especially when they are in large numbers. Having a swarm of them near your home can cause harm to your fruits inside the house.

Given that the females lay eggs beneath the fruit skin, there is nothing worse than biting into a fruit-filled with fruit fly maggots.

To stop them, you have to always keep your compost in check because it is better to stop them when they are few in number.

The above methods will help you get rid of these insects, regardless of their number, to keep your compost and fruit safe.

We hope this article has been of some help to you.