Small flies or gnats in the kitchen are probably fruit flies. Fruit flies can be a problem year-round, but are especially common during late summer and fall because they are attracted to ripe or fermenting fruits and vegetables.
Tomatoes, melons, squash, grapes and other perishable items brought in from the garden are often the cause of an infestation indoors. Fruit flies are also attracted to rotting bananas, potatoes, onions and other unrefrigerated produce.
The best way to avoid problems with fruit flies is to eliminate sources of attraction. Produce that has ripened should be eaten, discarded or refrigerated. Cracked or damaged portions of fruits and vegetables should be cut away and discarded in the event that eggs or larvae are present in the affected area.
A single, rotting potato or onion forgotten at the back of a pantry or fruit juice spillage under a refrigerator can breed thousands of fruit flies, as can a recycling bin stored in the basement that’s never emptied or cleaned.
People who can their own fruits and vegetables or make wine, cider or beer should ensure that the containers used are well sealed; otherwise, fruit flies will lay their eggs under the lid, and the tiny larvae will enter the container upon hatching.
Windows and doors should be equipped with tight-fitting (16-mesh) screens to prevent adult fruit flies from entering from outdoors.
Once a structure is infested with fruit flies, all potential breeding areas must be located and eliminated. Unless the breeding sites are removed or cleaned, the problem will continue no matter how often insecticides are applied to control the adults.
Finding the source(s) of attraction and breeding can be very challenging and often will require thought and persistence. Potential breeding sites that are inaccessible (e.g., garbage disposals and drains) can be inspected, just tape a clear, plastic, food storage bag over the opening to the site overnight. If flies are breeding in these areas, the adults will emerge and be caught in the bag.
After the source of attraction and breeding is eliminated, a pyrethrum-based, aerosol insecticide may be used to kill any remaining adult flies in the area. Always read and follow label directions to ensure the safe use of any pesticide.