Lots of “gnats” are active at this time of year—some of them are fruit flies, others are not—and some are not gnats, either. Find out what you have; approaches for dealing with them vary, as do chances for success, and they will depend on accurate identification.
Fruit flies are common household pests at this time of year. The Internet can show many creative ways to deal with them, but most are focused on killing or trapping the adults. The key to eradicating persistent problems is finding sources of infestation and eliminating them.
Finding the source(s) can be very challenging and often will require much thought and persistence. Fermenting or over-ripe fruits and vegetables are common sources, but if they are not the issue, then expand the search to garbage cans, garbage disposals, and drains. Cracked or damaged portions of fruits and vegetables should be cut away and discarded to eliminate eggs or larvae present in wounded areas. A single rotting potato or onion forgotten at the back of a closet or fruit juice spillage under a refrigerator can breed hundreds of fruit flies, as can a recycling bin stored in the basement, which is never emptied or cleaned
Baited traps can be used to collect adults and may reduce small infestations but are unlikely to solve chronic problems. Traps can be helpful in identifying rooms or sites that are producing the flies. More information is available in this UK publication on fruit flies (ENTFACT-621)
By Lee Townsend, Extension Entomologist