Jeffrey Hahn, Asst. Extension Entomologist
Fruit flies can potentially be carried into homes in fruits and vegetables or they could fly in from the outside. Once in homes, they are attracted to fermenting and souring smells, e.g. around garbage containers and produce that is starting to become overripe. Fruit flies lay their eggs in a wide variety of sites as long as they are moist, contains fermenting organic matter, and are in reasonably undisturbed places.
You can help prevent fruit flies by eating fruits and vegetables while they are fresh or keep them refrigerated; do not allow produce to sit out and become overripe. Also, keep the inside of garbage containers clean from food residues. Rinse bottles and cans that you recycle and remove recyclables on a regular basis. Don't forget to periodically clean recycling containers to prevent a build-up of food residue. Remove garbage in tied plastic bags on a regular basis.
If you find you have a persistent problem with fruit flies, the most effective, permanent control is sanitation, i.e. eliminate their food source. Fruit flies are commonly found infesting overripe fruits and vegetables like bananas, tomatoes, potatoes, and onions. Also look for them around soft drink, wine, and beer bottles and cans that are being saved for recycling as well as in the recycling container itself. Another common site is trash containers especially when they are lined with plastic bags (look between the liner and the container). Remember that the source of the infestation may not be where the adult flies are found.
Fruit flies, however, will take advantage of a wide variety of different food sources and there are also plenty of unusual sites where you may discover fruit flies. You may need to be a detective and be imaginative to determine where they are coming from. In one case, fruit flies were infesting a tea maker after tea was brewed but was not cleaned out before it was put away. In another instance, they were found in rotting osage oranges (non-edible fruit that are purported to repel insects, spiders, and rodents) that were left out and forgotten. Remember that fruit flies are found in moist, undisturbed places where fermenting organic material is found.
Some people are tempted to spray fruit flies with an insecticide. While that will kill the flies you see, it is not a long term solution and more will return. Just spraying adults doesn't have any impact on the source of the infestation and the larvae that are developing. As long as a food source still exists, adults will continue to be present.
Fruit fly traps (either store bought or homemade) generally do not eliminate fruit flies. While you may capture some individuals, like spraying, it is difficult to catch them fast enough to actually eliminate them. However, you could use traps to help narrow down where infestations are located. By placing traps in every room, the trap with the most fruit flies usually indicates approximately where the problem can be found.