Preventing Fruit Flies in Your Compost - Uncle Jim's Worm Farm

Preventing Fruit Flies in Your Compost

Compost, Red Worms, Vermicomposting

fruit fly on bananaFruit flies are annoying little bugs that like to invade the house. The Drosophila melanogaster is attracted to organic matter like fruits and vegetables. Fresh fruit on the counter or in a bowl can attract them. How do they get in the house? Are they preventable? Are there natural methods to get rid of them? For over 40 years, these questions have been bugging Uncle Jim’s Worm Farm customers.

Fruit Flies in the House

Sometimes a fertile fruit fly comes in through an open door or window. It’s more likely, however, that their eggs, pupae, or larvae have hitched a ride in your produce. Just beneath the surface of fruits and vegetables is where fruit flies like to lay their eggs. Once in your house, they typically stay near sources of food, though they also gather near sinks and other places, like your kitchen scrap bin and composting bin.


Whether it’s inside or outside, families who compost tend to collect their wasted organic materials in a bin or pail before moving them to their composting bin. Many families make use of vermicomposting, which means their bin contains worms that break down leftover food scraps into fertilizer. Worms quicken the composting process. The best composting worms are Red Wigglers. Uncle Jim’s Worm Farm is #1 when it comes to composting worms and supplies.

People like vermicomposting because it provides them with all-natural fertilizer that is more nourishing than regular compost. All composting is great for the environment, but fruit flies will take advantage of the food waste.

Preventing Fruit Flies

It’s best to keep produce refrigerated to dissuade fruit flies from accumulating. Fruit flies don’t like colder temperatures. Fruit flies will be attracted to your compost container if you leave it out at room temperature. If you vermicompost indoors, make sure you cut up your scraps as small as possible. Bury them into the worms’ bedding. Not only do worms break down small scraps quicker than large scraps, but fruit flies will have a difficult time with the scraps that have been buried.

Getting Rid of Fruit Flies

While fruit flies cannot physically harm you, they are unsanitary, so you should get rid of them as quickly as possible. Swatting at them with a fly swatter will not do anything as they are too small. Try a vacuum cleaner, hand vac, or shop vac. The force of the vacuum kills them. However, this will only get rid of the visible fruit flies. Where there are flies, there are eggs and larvae, which will develop into more flies, and you will be vacuuming them forever. A better solution is to set up a trap to outsmart them and get rid of them.

Making a Trap

You can make a fruit fly trap in as little as 5 minutes. The trap will turn their attraction to food scraps against them. As bait, you will use apple cider vinegar, which has an aroma that attracts the flies. You will also need dish soap to break the surface tension, which will cause them to drown in the mixture. The next part is crucial: making a funnel so they cannot escape. You can use a kitchen funnel, or you can easily make one with a piece of paper and some tape.

To make the trap: 

  • Pour one inch of apple cider vinegar into a cup or jar (something that gets smaller towards the opening)
  • Add a drop of dishwashing liquid
  • Place the funnel at the top of the cup or jar with the tip pointing down. The tip should not be touching the mixture
  • Secure the tunnel in place with tape

Put the trap where you see the most fruit flies hanging around. Do NOT place it directly in your compost.

In just a few days, most of the visible (adult) fruit flies will disappear. While new flies may hatch, they will also fall victim to your trap. In a month or less, your fruit fly infestation should be over.

The liquid in the trap will accumulate flies. If this bothers you, just dump the mixture and add fresh liquids.

If you don’t want to make your own trap, Uncle Jim’s also carries fruit fly traps for purchase.

Fruit Fly Free

Do not let fruit flies take over your home. By following these tips and tricks, your home should be fruit fly free, allowing you to continue composting unbothered. Enjoy your composting!



6 thoughts on “Preventing Fruit Flies in Your Compost

  1. I have been growing red wigglers in my basement for several years now. I am a Master Gardener through Rutgers University and on the Green Team in New Milford, NJ. My intention is to encourage children to grow worms so as to learn all the good things they will learn from their experiences. I signed up for your affiliate program. My hope is that our town can purchase the hot frog composting materials in the same way they purchased the Earth Machines composting bins and make them available to the residents at cost. I can provide them the worms from my operations.
    I am also working with associates to grow fish in an aquaponics recirculating tanks program. See website below.

  2. I’ve had composting worms in my garage for years! Tried all sorts of tricks to discourage fruit flies. What I’ve discovered…I keep my compost bowl in my freezer. When it’s full, it goes to the worms. Haven’t had an issue with fruit flies since I started this procedure, and I’ve been doing this for the past few years.

  3. Is cinnamon ok for worms? I have a huge untamed population of soil mites and have read that cinnamon is a good killer of mites. I don’t want to harm my red wiggles tho! Please give me some advise. I have a 45 gallon living soil pot that’s being over ran with mites!

    1. Hi! Worms can be finicky, although it may not harm the worms, I would suggest going a different route. If you find your worm farm overrun by mites, expose the beds to the sun for a few hours. Cut back on water and feed and then, every 1 to 3 days, add calcium carbonate. Add additional shredded paper or coconut coir to absorb any excess moisture. Drain off any liquid that has collected in the base and check to make sure the spigot is not plugged. Remember to not over-water you bin. You always want to keep the beds damp, not wet! I hope this helps!

  4. I had trouble with fruit flies on the top of my worm bedding a couple of years ago. I had been covering the bin with a newspaper and the flies would fly everywhere when i would take the paper off. I got rid of them by clearing the room air with traps and non poisonous insect spray, and shooing the flies off the bedding, while the flies were shooed away, I covered the bin with black lawn cloth. This took a few sessions to get rid of the flies, but being continually covered by it, they couldn’t get back in. The black cloth is air permeable, and the worms like the darkness. Still, no fruit flies. Of course, always bury the garbage when feeding the worms.

Leave a Reply

Your email address will not be published. Required fields are marked *

Send this to a friend