Epic Gardening is reader-supported. When you buy through links on our site, we may earn an affiliate commission. Learn more
Garden Pests

Fruit Fly Pests: Keeping Them At Bay

The fruit fly is an incredibly common pest on freshly-picked produce. Find out about them and good methods of prevention with our guide!


While going on vacation is one of the best parts of summer, it also means not tending to our gardens for days and even a few weeks at a time. I recently went away on a week-long trip during which there were several thunderstorms. When I came back, I saw many of my tomatoes had split from the rain. Along with the rain came a fruit fly infestation, like a veritable storm of them.

Fruit flies are a common late summer pest both outdoors as well as indoors. Fruit flies are attracted to the smell of ripe and fermenting fruits and vegetables and are a tough problem to prevent. In this blog, we’ll cover some ways to deal with them in the garden and get rid of fruit flies in your home. 

Good Products At Amazon For Fruit Fly Prevention:

Fruit Fly Overview

Drosophila spp. Fruit Fly
Drosophila species fruit flies are the most common in most US gardens. Source: gailhampshire

The common fruit fly, Drosophila melanogaster, is also known as the vinegar fly because of its attraction to the pungent smell of ripe fruits and vegetables. Drosophila melanogaster is just one of many fruit fly species in the Drosophila genus. Fruit flies are drawn to specific aromatic compounds that send signals to their antennae and are believed to have originated from sub-Saharan Africa. Adult fruit flies can range between 3-4 mm long with yellow or brown bodies and distinctive red eyes. Adult flies have two antennae, each with three segments ending in tiny hairs. Fruit flies undergo sexual reproduction and each female fly can lay up to 100 eggs per day and 500 eggs in her lifetime. 

Life Cycle of Fruit Flies

Fruit flies have very short life cycles spanning 8-10 days from egg to adulthood depending on the temperature. They are particularly active in the summer and virtually disappear when the weather gets cold. Their rapid reproduction rate makes fruit flies the perfect species to use in science labs for various genetic experiments and they have been the main contributor in at least nine Nobel-prize-winning studies!

Fruit flies undergo a complete metamorphosis. Each fruit fly starts with an egg, which then hatches into a larva with three instar stages. The larvae grow and molt during each instar, then becomes a pupa, and finally emerges as an adult fruit fly. Adults become sexually active quickly after emerging from their pupae and can start mating within 24 hours. 

Fruit flies lay their eggs in moist locations, often in or on fermenting fruit. Both fruits and vegetables can be habitats for these pests, particularly as they’re decomposing. It’s not uncommon to find fruit flies near fermenting produce in a compost pile. Female fruit flies lay up to 500 eggs throughout their lifetime. With such a short life cycle, that means multiple generations of them can appear in a single season.

Common Habitats

Have you ever heard of the saying, “time flies like an arrow and fruit flies like a banana?” It turns out that although fruit flies are attracted to bananas, they have a stronger preference for citrus, especially when it’s time to lay their eggs.  The fruit fly that we all know today is a generalist and can be found on many common foods. They are also frequently found on unpicked ripe fruits outdoors along with other insects like the citrus fruit fly.  

However, scientists who sought out the origins of the fruit fly traced its relationship with humans to a southern African fruit called the marula (Sclerocarya birrea), which human tribes loved and stored in their cave dwellings. Marula is a very sugary fruit with a highly fermentable pulp and a staple in the diet of these tribes. Researchers hypothesize that this is how fruits flies and humans became commensal or “eating from the same table”.

What Do Fruit Flies Eat?

Fruit flies are not picky eaters and will feed on just about anything. Despite their name, fruit flies are flexible to consume various foods in addition to fruits including onions, potatoes, and even dew secreted by aphids to name a few. The fruit fly larvae feed on the yeast produced by decaying plant material. 

How to Control Fruit Flies

Xanthaciura spp. Fruit Fly
Xanthaciura species fruit flies are found in the southeastern US. Source: Judy Gallagher

Fruit flies are very hard to control because they reproduce very quickly and are pervasive. They are one of the most common food contaminants for growers, grocers, and restaurants. Even if your home does not have fruit flies, you may inevitably bring home a piece of fruit or vegetable that contains eggs or larvae that will hatch and reproduce in your home.  However, some sanitation best practices can help keep down their population and get rid of fruit flies where possible. 

Organic or Chemical Control

Organic spray, like horticultural oil, can be used to either kill adult flies or prevent eggs from hatching. Organic sprays are not as effective against adults because the liquid needs to come in contact with the flies in order to work. Apply sprays regularly to mitigate against the rapid generations of these flies. 

Chemical sprays are more typically used in orchards and commercial operations. They may not be specifically targeted for fruit flies and can harm other beneficial insects. Farm managers use a combination of techniques like using sticky traps or sex pheromone traps to monitor the population of adult fruit flies and spraying the fruits. These methods are employed in addition to general sanitation practices. 

Environmental Control

Fruit flies traps are a common way of environmental control. They are commercially available or can be easily made with household materials. A simple and effective fruit fly trap is to fill a jar with a few inches of apple cider vinegar, beer, or wine and add in a few drops of dishwashing liquid. The flies will be attracted to the scent of the fermenting liquid. The soap will break the surface tension of the apple cider vinegar and fruit flies will fall in and drown. Place the trap near susceptible fruits and dispose of the solution with the flies every few days. 

You can make a similar fruit fly trap by placing bait like a piece of banana or a bit of apple cider vinegar at the bottom of a mason jar and creating a paper funnel that sits on top of the jar. Fruit flies will be able to fly in but not be able to fly out of the fruit fly trap. You can also combine these two methods to increase the efficiency of your trapping technique! 

Preventing Fruit Flies

One of the most important elements to control fruit flies is to eliminate their breeding sites. Indoors, this means taking out the trash in your home, mopping up sugary spills, throwing out rotting fruits and onions, and frequently cleaning out your drains and garbage disposals. Don’t forget about beer cans, wine bottles, and cider bottles and cans!

Refrigerate produce if possible because fruit flies cannot develop under cold temperatures. If you make your own jam, kombucha, or other fermented foods and condiments, follow the sanitary best practices and have tight seals for your jars. Just like with master gardeners, many state extension services also have master food preservers to provide help and guidance with all things home food preservation.

Outdoors, it’s important to keep the garden or orchard tidy. Pick up and pick off any fruits that are rotting or have visible fly infestations. For produce like tomatoes, you can harvest them before they are fully ripe so they don’t split and spoil on the vine.

If you compost, putting a tarp over your pile or a cover on your compost bin can reduce the access to overripe produce near the surface of the pile. It can also help to heat up the compost, and high heat can kill the larvae and eggs as well as any adults trapped in the heat.

Frequently Asked Questions

Ceratitis spp. Fruit Fly
Ceratitis spp., also called Mediterranean Fruit Flies or Medflies, can be annoying. Source: jeans_Photos

Q: What is the fastest way to get rid of fruit flies?

A: The fastest way to get rid of fruit flies is to get rid of their food source and breeding ground. This means keeping indoor and outdoor surfaces free from rotting or overripe produce. If they can’t breed, they can’t produce the next generation of pest insects. 

Keep garbage disposals and drains clean and free from debris from vegetables or fruit. Store food promptly to prevent adults from laying eggs on its surface. Keep trash receptacles closed to prevent infestation.

Q: What attracts fruit flies to humans?

A: Fruit flies are food generalists that are attracted to many foods that humans grow and consume. Scientists believe that the fruit fly-human relationship developed around 10,000 years ago when humans started eating and storing a Southern African fruit called the marula and that fruit flies were originally food specialists who feed exclusively on marula fruits.

Related Categories
Products in this article