To get rid of fruit flies, eliminate any damp areas where decomposing organic matter is present, and store fruit and other food sources in bins or the refrigerator. Commercial fly spray can be used to eliminate adult flies.
Fruit flies are attracted to damp areas where decomposing organic matter is present, such as damp bathrooms or overwatered soil. Remove any buildup found in showers, bathtubs, sinks and drains by cleaning bathrooms thoroughly, and allow the soil in the garden and houseplants to dry before watering. Clean bathroom and kitchen drains with a firm, long-handled brush and a bacterial drain cleaner to eliminate fruit larvae.
Fruit flies are also attracted to empty cans or bottles, as well as overripe produce. Store fruit in the refrigerator, and pick up fallen fruit from trees as quickly as possible to control and prevent infestations. If large quantities of produce, such as potatoes, are present, examine the produce carefully for signs of decay that may attract the flies. Empty cans and bottles should be stored in bins with tight-fitting lids or disposed of immediately, and recycling bins should be cleaned on a regular basis. Adult fruit flies can be eliminated using pesticide spray that is labeled for indoor use.