DIY Hacks to Rid Your Home of Fruit Flies and Keep Them Away for Good

Summer is on its way but along with warmer weather, barbecues and trips to the beach, the season will bring fruit flies. These tiny pests are not only gross, they also multiply fast, so you must act quickly to prevent a major infestation in your home. Fortunately, there are many ways to get rid of them, using everyday items you can find in your kitchen.

What Are Fruit Flies?

Fruit flies—known scientifically as Drosophila melanogaster—are attracted by fruit, vegetables and fermented drinks such as beer and wine. They can show up any time of year, but they're more common in the summer because of seasonal produce and the heat speeding up food decomposition.

Fruit flies treat produce as a breeding ground. Females lay their eggs close to the surface of damp, organic materials, which is why you might spot them in your trash or drains. They breed quickly, with a female fruit fly laying roughly 100 eggs at a time, and can reach adulthood in just 10 days.

Laurie Stevison, assistant professor of biological sciences at Auburn University, told Newsweek: "If you have just a handful of fruit flies, you can have a major problem in just a week and a half."

To avoid this, try one of these three DIY techniques to rid your home of the pests:

  • Catching fruit flies in a jar
  • A yeast trap
  • The beer trick

Catching Fruit Flies in a Jar

This hack went viral on TikTok last summer after being shared by user Amanda Milne, who explained how she put together a budget trap using items from her kitchen cupboards.

All you have to do, Milne said, is put some fruit at the bottom of a jar, then place a paper cone at the top. The funnel means flies can enter the jar but cannot get back out.

Even more effective than ripe fruit is apple cider vinegar, because it both attracts the flies and kills them by drowning.

Stevison recommends that you add dish detergent to kill the flies off more quickly.

"[The detergent] changes the surface tension of the liquid, so the flies basically get stuck in there a lot easier," she said.

A Yeast Trap

This method also uses a jar to trap bothersome fruit flies. To make a yeast trap, find a jar or another container and fill it with one-quarter to three-quarters of a cup of warm water.

Tip a packet of activated dry yeast into the water, along with one teaspoon of sugar. Mix the concoction together and wait a few minutes for the yeast to expand. When it starts foaming, this means it is releasing carbon dioxide.

Put a small plastic bag over the mouth of the container, making sure one corner is pointing into the jar. Poke a small hole into this corner with something small and sharp, like a pencil. The corner of the bag acts like the cone in the fruit trap—once flies are in, they can't escape through the same opening. Secure the bag tightly with an elastic band or hair tie.

Stevison said a yeast trap is one of the more humane options, because of carbon dioxide's effect on fruit flies.

"In the lab, we use carbon dioxide to anaesthetize them, so I can see a yeast trap being very effective," she said.

Clean out the trap thoroughly at least once a week to ensure any larvae are disposed of and prevent a new generation of fruit flies from taking over your house.

The Beer Trick

Another effective hack involves your favorite alcoholic beverage. Drink or tip away half a bottle of beer or wine, then leave it somewhere that fruit flies congregate—it won't be long before they're hopping inside for a sip.

It's not the alcohol that kills the flies, but drowning, Stevison said.

"As they feed on rotting fruit, they actually have a decent alcohol tolerance. The liquid definitely kills them, so using an empty wine bottle or beer bottle with a little bit of residue sounds like a great trap."

How to Prevent Fruit Flies From Coming Back

To stop fruit flies returning, clean up any sticky spills, empty your trash daily, rinse your recycling and make sure all containers are sealed tightly—particularly during hot weather.

Stevison also recommends not leaving doors or windows open for long periods of time and eating produce while it is fresh.

"They want that rotting fruit, so if it's super fresh, they won't be attracted to it as much. Or you can keep it in the refrigerator," she said.

It's also a good idea to wash any produce you bring home in case they're covered in eggs or larvae, and to set up a covered compost bin specifically for produce to prevent them getting into your waste. Don't forget to wash your dish sponges and clothes frequently, and use a fan during food prep to blow away any fruit flies trying to land on your ingredients.

Incense has been used to repel all kinds of pests for centuries—and it makes your home smell good too. Use an incense stick in your favorite scent to keep bugs away.

If you love the smell of lemongrass, you'll be pleased to know that it's a common ingredient in commercial insect repellents. You can make your own version too. Mix 10 drops of lemongrass essential oil with 2 ounces of warm water. Tip it into a spray bottle and squirt it in the places fruit flies like to hang out, such as doors, windows, drains and your trash or recycling.

Simple DIY Hacks to Kill Fruit Flies
Close-up of a fruit fly on a lemon. The pests are attracted to overripe produce—and can become a big nuisance if an infestation is not tackled quickly. nechaev-kon/iStock/Getty Images Plus