Overrun by pesky little flies? Here's how to get rid of them and keep them from coming back.
bowl of fruit with Ask the Test Kitchen logo
Credit: Getty

Fruit flies can be an annoyance year-round, but most of these tiny pests show up in the summer and fall. That's because they're attracted to ripe or decaying fruits and vegetables (and produce decays more quickly when it's hotter). Fruit flies lay their eggs—up to 500 at a time—on the surfaces of these foods, so they can hitchhike inside your home on produce from anywhere, including your garden, local farm stand or supermarket.

How to prevent fruit flies from multiplying in your home

Here are a few preventive measures to implement during fruit fly season:

Wash produce under cold running water as soon as you get it inside. (Be sure to dry it before storing.)

Don't let fruits and veggies you leave out on the counter (think: tomatoes) sit too long before enjoying them. As they continue to ripen, they can attract flies.

Cut away and discard any cracked or damaged portions of your produce and refrigerate what you've saved.

Fruit flies like to breed in moist kitchen areas such as drains, garbage disposals, trash cans, empty bottles and cans, mops and cleaning rags. Regularly remove garbage, recycling and compost and keep these other spots and items clean and dry if at all possible.

When you find something decaying in your kitchen, bring it outside to the trash or your compost pile immediately.

How to get rid of fruit flies

If fruit flies are already in your home, here's what to do:

Set cider vinegar traps. This mimics the sweet-pungent scent of rotting fruit and attracts the flies. Cover a glass or jar—baited with a few tablespoons of cider vinegar—with plastic wrap and poke holes in it. The flies will go in and get stuck in the vinegar.

Get rid of potential breeding areas. This may mean removing produce from your counter, cleaning and drying out trash cans and mops—wherever you spot flies. If you've seen them in your sink drain or disposal, tape a clear plastic food storage bag over the opening overnight: emerging flies will be caught in the bag.

Breana Killeen, M.P.H., R.D., is the Eating​Well Test Kitchen manager.

Got cooking, shopping or other kitchen-related questions? Email them to us at testkitchen@eatingwell.com.