How to Get Rid of Fruit Flies That Have Commandeered Your Kitchen

Summer produce at its finest means fruit flies are also at their finest. And by finest, I mean wining, dining, and breeding all over your countertop. The good news: Getting rid of fruit flies doesn’t require an exterminator—or much more than a jar, a piece of paper, and some past-its-prime fruit.
The fastest way to get rid of fruit flies is to attack the problem from both sides: Remove their food source, then trap the flies that remain. After experimenting with different fruits, vinegars, containers, and funnel sizes, I’ve determined the best homemade fruit fly trap is a simple paper funnel tucked into a jar with overripe strawberries, cut stone fruit, or banana peels, plus a splash of fruity vinegar. Here’s how I got there:
Why do fruit flies suddenly appear?
Fruit flies don’t appear out of nowhere. The pesky little bugs typically hitch a ride to your house on fresh produce purchased at the grocery store or farmers market, then multiply quickly once they find an attractive food source.
Washing produce thoroughly can help get rid of adult flies, but there’s no easy way to tell if they’ve already laid eggs in your food (yes, in…). If they find an adequate food source in your kitchen, they’re more than happy to set up camp. They’re especially drawn to overripe fruit, vegetables, compost, recycling bins and trash cans, garbage disposals, and anything that’s starting to ferment. Fruit fly larvae typically hatch within a day or two and spend the next week chowing down. Within a week or so, they’ll be full-grown adult fruit flies who will then lay their own eggs. This rapid life cycle is why getting rid of fruit flies can be so tricky.
Read more: 10 Tips for Keeping Produce Fresh Until Your Next Grocery Run
There’s a chance the gnats you see flying around aren’t fruit flies at all. Fruit flies are small brown bugs with red eyes, but they’re easy to confuse with fungus gnats and drain flies.
Fungus gnats are black and are more commonly found milling around the soil of houseplants. Drain flies have larger V-shaped wings—they almost look like tiny moths—and are usually found hovering around sink drains (surprise!) or garbage disposals. You’ll need to clean their respective hangouts to prevent egg-laying, but the same traps often work on these pests.
How to get rid of fruit flies
Start by deep cleaning your kitchen: Remove any ripe or rotten food where the flies may have laid eggs. That means throwing away anything sitting on your kitchen counter. It might seem like a waste, but fruit fly larvae tunnel into produce to feed—so, you know…do you really want to eat that apple? Until you’ve successfully vanquished the bugs, thoroughly wash any new produce you bring home and store it in the fridge.
Fruit flies may also use your trash can and compost bin as a breeding ground, especially when there’s rotting food inside. To that end, take the garbage out more frequently and clean your trash can. You’ll also want to flush your garbage disposal: Grind a handful of ice cubes to dislodge any stuck-on food, then rinse with hot water. Regularly wipe down counters to ensure the flies don’t find any food or remnants of sticky spills. Generally, keep your kitchen as clean as possible for at least a week to prevent female fruit flies from laying more eggs.
The best homemade fruit fly trap we tested
I started out by plugging in a fresh-from-Amazon light-up trap, which did little to quell the growing army of bugs. Then I turned to DIY. The soap and vinegar bowl? Didn’t work at all.
After trying several homemade fruit fly traps with different fruits, vinegars, containers, and funnel sizes, one setup consistently worked better than others: A funnel set over a jar of cut fruit. The sweet smell of rotting fruit is irresistible to fruit flies and draws them in through the funnel. After feeding, they instinctively fly upward toward the exposed sides of the jar instead of returning to the small opening. Then they fly around and around until they eventually die. It’s like the most disgusting snow globe ever.
- Tall glass jar with a wide opening
- Sheet of paper (parchment, notebook paper, a rejected insurance claim, etc.)
- Tape
- Overripe fruit
- Fruity vinegar such as apple cider vinegar, red wine vinegar, or balsamic
As a big fruit eater, I tested several fruits and vegetables to see which attracted the most flies.
| Bait | Results |
|---|---|
| Very ripe strawberries | ⭐⭐⭐⭐⭐ |
| Overripe stone fruit (peaches, nectarines, plums, cherries) | ⭐⭐⭐⭐⭐ |
| Banana peel | ⭐⭐⭐⭐☆ |
| Cherry tomatoes | ⭐⭐☆☆☆ |
| Corn kernels | ⭐☆☆☆☆ |
Very ripe fruit consistently worked best, especially when the flesh was exposed. Fruit flies are attracted to fermenting sugars, so a bruised peach or sliced strawberry is much more enticing than perfectly fresh produce. You also don't have to use whole pieces. Use the off-cuts, like the tops of strawberries you’re using to make a pavlova or that gnarly spot on an otherwise perfect plum.
Do not overfill your jar. The fruit should fill only about one-eighth of the container, leaving roughly 2 inches of empty space between the bait and the paper funnel.
Pour just enough vinegar over the fruit to lightly coat the bottom of the jar. The vinegar itself doesn't kill the flies in this setup; its aroma helps lure them into the trap. I found the best vinegars for trapping fruit flies to be fruitier varieties like apple cider vinegar, white balsamic, and red wine vinegar; rice vinegar also works surprisingly well. Skip distilled white vinegar, which isn’t nearly as effective.
Find a piece of paper. I used an 8.5-by-11-inch electric bill, but any piece of paper (ripped from a magazine or your kid’s science notebook or a lovely bit of used parchment) works. Fold the bottom-left corner up and around to the center of the back side of the page. Finesse the cone until the bottom hole is about 1 inch in diameter—large enough for flies to crawl inside but small enough that they have trouble finding their way back out. Start small; you can always use scissors to cut a larger hole if needed. Tape the loose corner to secure the cone in place and stick the cone into the jar so that there is at least 2 inches of empty space between the bait and the tip of the cone.
Try to determine where the majority of the fruit flies are congregating and place your trap as close to ground zero as possible. Think next to your fruit bowl, near your compost bin, or on the back of the sink if you think they might be drain flies. Don’t try hiding the trap under a tin or inside a cabinet; the flies need easy access.
After 24 hours, dump your trap and start over. When disposing of the trap, be careful not to let the flies escape. This means using quick, decisive movements to crumple the paper into the jar and seal it. If you are using a cup and not a jar, place a piece of plastic wrap on top. Shake the contents to ensure the flies are dead, then either flush them down the toilet or transfer them to a plastic bag and take them outside ASAP. Wash the jar and repeat. Continue this cycle until the flies…what flies?
How long does it take to get rid of fruit flies?
Small infestations often improve within two or three days, while larger infestations may take a week or longer. You should start seeing flies in a well-placed trap within 24 hours. Because new adults can continue to emerge from eggs that have already been laid, keep removing food sources and resetting the trap until activity dies down. Once it takes longer than a day for the trap to fill, you can leave it for a few days before changing it out.
What if my fruit fly trap isn’t working?
If you've had a trap out for several days with little success, there could be a couple of issues at play.
If the trap isn’t catching anything
Most likely, your bait isn’t ripe enough. You should also check that the hole in the tip of your funnel is neither too large (allowing the flies to escape after feeding) nor too small (if they can’t get in, they can’t die).
They aren’t fruit flies
You may be dealing with fungus gnats or drain flies. If either is the case, reevaluate the trap’s placement. For fungus gnats, you’ll also need to address the soil of your plants as the bugs will have buried their eggs under the surface.
Remove their breeding ground
Last, inspect your home for other food sources that might be sustaining the bugs. Move ripe fruit to the fridge or use it up. Make sure there isn’t a glass of half-drunk wine on the table behind the sofa. Wipe up sticky spills. And clean your garbage disposal and drains.
Should you use dish soap in the trap?
Not necessarily. Dish soap helps drown flies in open vinegar traps, but the paper funnel method doesn’t rely on soap because the flies become trapped inside the jar. If you want to try it, just 2 to 3 drops of liquid soap are sufficient.
Store-bought fruit fly traps
If you’ve cleaned your space and sealed all of the fruit on your counter, but the flies persist, there’s a possibility flies are living and breeding in your drains and pipes. EcoStrong Drain and Fruit Fly Eliminator removes the flies’ habitat by eliminating their food source. The viscous gel works by coating the walls of your pipes with a solution that eliminates the residue the flies are attracted to.
The instructions are very specific, and it’s important to read and follow them carefully. This includes completely filling your sink and draining the water quickly, letting the drain dry for 2 hours, pouring 8 oz. of the product down the drain, and then making sure not to use the sink for 6 hours.
The TERRO Fruit Fly Trap comes with a liquid you pour into an apple-shaped container. The scent lures in the fruit flies, then they drown in the liquid. A similar option, Flypunch comes in a container resembling a spice jar. Simply flip the lid and place it near the bugs. While these both work similarly to our preferred paper cone method, we’ve found the fresh fruit a more surefire draw (and it’s less expensive if you already have the supplies).
Some of our editors have also had success combatting a small infestation with Zevo, a device that attracts flying insects overnight with light. A sticky film ensnares any bug that gets too close, and they eventually die.
How to keep fruit flies from coming back
Once you've gotten rid of fruit flies, a few simple habits can help keep them from returning.
- Refrigerate ripe fruit whenever possible.
- Empty compost frequently.
- Rinse recycling before placing it in the bin.
- Wipe up juice, wine, and beer spills promptly.
- Wash produce after bringing it home.
- Check onions and potatoes regularly for spoilage.
- Clean garbage disposals and drains routinely.
The bottom line
The fastest way to get rid of fruit flies is to tackle the problem from many angles. First, remove their food source and set a trap nearby. In our testing, a paper funnel trap baited with overripe fruit and fruit-forward vinegar consistently caught the most flies. Pair that with a clean kitchen, including your compost bin, drain, and trash can, and most infestations should noticeably improve within just a few days.
Editor’s note: This story was originally printed in April 2022 and includes earlier reporting from Camryn Rabideau. The paper cone method is a result of testing by Emma Jacobson.




