12 Ways to Get Rid of Fruit Flies Naturally

bowl of old fruit and bruised banana that attract fruit flies on kitchen counter

Treehugger / Alexandra Cristina Nakamura

If you see tiny little gnat-like insects buzzing around your kitchen, there's a good chance they're fruit flies. These pesky bugs can be a problem all year, but they're most common during summer and into fall. That's because they love ripened fruits and vegetables, which are abundant during these seasons.

When you bring in tomatoes, squash, or other goodies from the garden, farmers' market, or grocery store, a fruit fly infestation can easily begin. These little bugs are quickly enamored with those overripe bananas, potatoes, onions, or other unrefrigerated produce left on your counter or in your pantry. Although overripe fruits and vegetables are their breeding ground of choice, they'll also breed in anything moist with fermenting material on it, such as drains, garbage disposals, garbage cans, and cleaning rags. Fruit flies are drawn to anything with alcohol or vinegar, too.

According to Washington State University, adult fruit flies are only about one-eighth of an inch long, but a female fly can lay 500 eggs in her extremely short life cycle—which is why the critters multiply so quickly. One minute your kitchen is fine. The next, it's overrun with fruit flies.

Here are 12 ways to combat fruit flies once they've decided to invade your home.

Trap Fruit Flies in Vinegar

glass jar of apple cider vinegar covered with plastic wrap with holes for flies

Treehugger / Alexandra Cristina Nakamura

Place a small amount of vinegar at the bottom of a bowl or cup (don't use white vinegar, but a cider variety, such as red wine, balsamic, or apple cider vinegar). If you haven't gone completely zero-waste in your kitchen yet (if you have, cheers!), cover the top tightly with plastic wrap. It may also help to place a rubber band around the plastic wrap to ensure it stays adhered to the bowl or cup. Poke some small holes in the wrap. The flies will crawl in, but they won't be able to get out.

You can avoid using plastic by creating a funnel out of a piece of paper and then putting it into a jar filled with a little cider vinegar. Put this trap wherever you've seen fruit flies. You can release them outside once you catch them.

Use a Banana As a Trap

ripe banana lays on wooden kitchen countertop

Jan Vojtek / EyeEm / Getty Images

Create the same funnel and jar trap as noted above (in our vinegar example), except use a bit of ripened banana or other fruit as bait, with or without the vinegar.

Make a Liquid Soap Trap

Fruit flies at the bottom of dish soap trap mixture.

jessamyn west / Flickr / CC BY-NC-SA 2.0


In a small bowl or cup, mix water with a couple of drops of dish soap and a tablespoon or two of cider vinegar. The vinegar will attract the fruit flies, while the dish soap will break the surface tension on the liquid so the flies will fall in and drown in the water. You can also use the funnel and jar method noted in our previous solutions to keep the bugs and bait contained.

Use a Carnivorous Plant

Consider getting a carnivorous sundew plant. Popular with gardeners, these plants trap fruit flies on their sticky leaves and then eat them. In this way, the plants provide an ongoing solution for your fruit fly dilemma.

Remove Damp Towels

damp rag left in steel kitchen sink will attract fruit flies

Treehugger / Alexandra Cristina Nakamura

Don't keep damp kitchen towels or dish rags lying around after you've used them. Try to wash your dish towels every day because they can be a breeding ground for fruit flies.

Don't Keep Ripe Fruit on the Counter

guy in striped shirt places overly ripe banana in fridge to hide from flies

Treehugger / Alexandra Cristina Nakamura

As fruit ripens and starts to ferment, fruit flies seem to appear out of thin air. To prevent this, put ripe fruit in the refrigerator and ripening fruits in paper bags on the counter. The cold of the refrigerator slows down the ripening of the fruit and the development of the flies. "As fruit ripens, it degrades, releasing ethanol, which hatches or attracts the flies," Ron Harrison, Orkin Pest Control’s technical director, says. "Washing facilitates degradation, as does a warm room."

Wash the Dishes

pile of dirty dishes left in steel sink will attract fruit flies

Treehugger / Alexandra Cristina Nakamura

Washing dishes as you use them can help cut down potential fruit fly breeding grounds. If there isn't sticky, gunky food around, fruit flies aren't tempted to lay their eggs in anything. Don't leave any cups filled with water or other liquids lying around, either. You'll want to remove any potential breeding areas to prevent fruit fly infestation.

Clean Out the Drain

A kitchen sink drain catches food.

Studio Driehoek / Getty Images

Cleaning the drain in your kitchen sink with ice or apple cider vinegar can help prevent fruit fly infestation, since the flies like to breed in the drain where bits of rotting fruit and vegetables often linger. Running a kitchen fan, if you have one, may also help keep fruit flies away.

Check for Rotten Produce

Rotting potatoes in a bag on a wood table.

schulzie / Getty Images

It's easy to remember to eat or toss the ripe produce on your counter, but what about those rotting potatoes or onions in the pantry? University of Kentucky Entomology suggests you cut off and throw away cracked or damaged parts of fruits and vegetables in case fruit fly eggs are present in those wounded areas. "A single rotting potato or onion forgotten at the back of a closet, or fruit juice spillage under a refrigerator can breed thousands of fruit flies. So can a recycling bin stored in the basement which is never emptied or cleaned."

Freeze Your Compost

Bags of compost in the freezer.

Padraic / Flickr / CC BY-SA 2.0


If you compost, you may want to consider changing your habits. Some bugs are great for the compost pile, but fruit flies can wreak havoc as they zip from your pile to your garden, laying eggs in your growing produce. Freezing vegetables and fruits before they become compost kills the flies and their eggs. Churn compost often, and consider hanging fruit fly traps near your compost pile. It's especially important to freeze produce scraps before you take them outside during the in-between months where the contents don’t freeze or decompose quickly outside.

Use Essential Oils

hands place potted basil plant near fruit bowl to discourage fruit flies

Treehugger / Alexandra Cristina Nakamura

Research has shown that basil can decrease fruit fly attacks. Raw basil plants may have a repellent compound; consider placing a basil plant near your fruit bowl or sprinkling basil leaves directly on your fruit. Fruit flies don't like strong smells, so try soaking a sponge in lavender oil or placing cedar balls on your counter where you keep fruit.

Wash Incoming Produce

bananas, oranges, carrots, onions grouped on striped kitchen towel

Treehugger / Sanja Kostic

You can unwittingly bring fruit flies home from the grocery store (they hitch a ride on produce in the form of eggs). So, washing fruits and vegetables as soon as you get home is one way to ensure they don't end up in your kitchen. Most people don't think of washing bananas, however. But these fruits can be covered in sticky substances from other produce, and that can be extremely attractive to fruit flies. To be extra careful, you can even set up a clean bucket outside your house to wash produce before bringing it inside.

View Article Sources
  1. Fruit flies.” Washington State University.

  2. Singh, Shalendra Pratap, et al. “Management of fruit flies in mango, guava and vegetables by using basil plants (Ocimum sanctum L.) as attractant.” Journal of Entomology and Zoology Studies, vol. 8, no. 1, 2020, pp. 311-314.