Fruit flies prefer sugary, organic mating, breeding and feeding grounds, and are able to detect and follow the smell of ripe fruit and vegetables from far away. While they prefer sugar, they also infest rotten meat and garbage, and are attracted to soda and alcohol.
Once a fruit fly colony is established, even removing fruit may not be enough to prevent them from breeding. Fruit flies can breed in slime or on old, sour mops and sponges. They can progress from egg to adult in eight days and live for a full 30 days, reproducing rapidly.
Over time, their population can be squashed by removing their access to food. Any over-ripe fruits and vegetables must be immediately thrown away. Fruit flies are very small and can find their ways through tiny cracks, so keep all food in airtight containers or in the refrigerator.
Wipe and spray counters regularly, cleaning up spills immediately. Empty trash cans without giving food time to rot and attract fruit flies. Clean drains by pouring boiling hot water or bleach down them, and bacterial digesters may be needed to fully eradicate the slime that fruit flies may be using to breed in. Traps can get rid of the adults, helping reduce the population over time.