Looking for a Fruit Fly Trap DIY? Here are 6 Safe Ways to Get Rid of Fruit Flies & Gnats!

As an Amazon Associate, Hip2Save earns a small commission from qualifying purchases in this post. Read our full disclosure policy here.

More Tips

Here’s a helpful fruit fly trap DIY!

using vinegar for fruit fly trap diy

What’s the buzz?

For anyone dealing with pesky fruit flies and gnats, the struggle is real! To help you win the war against these pests, here are some safe ways, tips, and tricks to prevent fruit flies and gnats and keep them out of your home.

orange fruit fly with red eyes next to black gnat

So what’s the difference between a fruit fly and a gnat?

While both fruit flies and gnats are extremely annoying, distinguishing between them is crucial so that you can effectively get rid of them.

Fruit Flies:

  • What do they look like? Beige or brownish-orange with red eyes.
  • How big are they? Mature adult fruit flies are normally around 1/8 of an inch.
  • Where they can be found? Fruit flies are normally found in the kitchen since they are typically drawn to mature fruits and vegetables. They also like damp and wet areas without much airflow. They can be found year-round but are most popular during the end of summer and early fall.


  • What do they look like? Black with delicate wings.
  • How big are they? Mature adult gnats are usually less than 1/16 of an inch.
  • Where they can be found? Typically gnats are found outdoors near moist areas, damp soil, or decaying matter such as composite sites. When found indoors, they like to hang out in old, potting soil. They can be found year-round in the right conditions.

How to get rid of fruit flies and gnats with these fruit fly trap DIY options:

1. Have them drink some red wine.

hand holding a glass of red wine

Effective for killing fruit flies.

Have you ever unintentionally caught a sneaky fruit fly in your glass of wine while having dinner?! Since wine is fermented fruit, fruit flies are very attracted to its smell. And, for whatever reason, stale red wine is their favorite, so this is a solid fruit fly trap DIY.

For families with busy kids or pets, leaving out a glass of red wine where it could spill might not be the most ideal way of getting rid of a fruit fly infestation. However, if you have some stale red wine you’d like to make use of, this is the perfect solution. Just pour it into a glass and leave it uncovered – or for peace of mind, cover your glass with plastic wrap and poke some holes. I have found both ways to be effective.

It probably goes without saying, but be sure to place the wine out of reach of kiddos (or nix this idea if you’re concerned about little ones getting their hands on it)!

2. Try this apple cider vinegar and dish soap DIY.

fruit fry trap dip solution

☠ Effective for killing fruit flies and gnats. 


  • 2 tablespoons of apple cider vinegar
  • 1 tablespoon of sugar
  • Dish soap (a few drops)
  • 1/2 cup of warm water

This is my favorite fruit fly trap DIY to get rid of flies, and I’ve found it to be the most effective solution whenever we’ve had a gnat or fruit fly problem. The aroma of vinegar and sugar will attract the flies, so placing this solution near an area you see them frequently is important. Place sugar and warm water into a small container and mix until dissolved. Then, stir in the vinegar and a few drops of dish soap. Cover with plastic, poke some holes, and leave it out overnight.

If you have a significant amount of fruit flies or gnats, you might need to make a few batches and place small containers in various areas around your house where you’ve spotted them. Leave your containers overnight and replace the solution with a new batch when you see bugs floating on the top of your liquid. Repeat until you notice no more fruit flies or gnats!

3. Leave out some mature fruit.

hand holding sliced banana in a glass covered with plastic wrap with bananas in the background

Effective for killing fruit flies. 

Fruit flies are called fruit flies because they love fruit! This is often why they take over your house. They normally smell fruit from your trashcan, or you might have ripe, delicious fruit sitting on top of your countertops that they simply cannot resist! One very easy way to kill fruit flies – especially if you already have fruit laying around – is to place some fruit into an open container. The more mature the fruit, the more sugars it will contain, which attracts more fruit flies.

For best results, cut up some fruit, like a banana, and place it in a container. (You can also add in some of the skin.) Then cover the top of the container and poke some holes. Make sure you eliminate other fruits and veggies on your counter so bugs are only being attracted to the food in the dish. Replace fruit that is overly mature or rotten after 24 hours to keep your house sanitary. Repeat the process if necessary.

4. Replant your plants with new soil.

fruit fly trap diy two green houseplants sitting on floor and wicker chair

Effective for killing gnats.

The most common cause of an indoor gnat infestation is potted plants living in old soil. They are attracted to a microscopic fungus that grows in potting soil, so this could more than likely be the cause of your gnat problem. This same fungus is also sometimes present on fruit, so keeping fruit washed after you bring them home will also help prevent gnats.

Gnats tend to stay close to where they breed since they don’t fly very well, so spotting them right at the source is generally pretty easy. To get rid of gnats, you need to remove their food source (i.e. give your plants some fresh, high-quality soil and keep your fruits and veggies clean).

5. Burn a candle in some water while dark.

cream candle in white dish with water and fruit in the background

Effective for killing fruit flies and gnats.

You’re probably thinking fire and water don’t mix, right? This experiment is meant to kill two birds with one stone…figuratively, of course!  😂 While some species aren’t necessarily attracted to light, many of them, including insects, are. Therefore, lighting a candle once it’s dark can be an irresistible draw.

When they become too close to the fire they…well, you know. 😬 And for species who don’t remain attracted to the light, placing your candle into a shallow dish full of water and a few drops of dish soap will end up being the end for whatever nuisances are left. While I haven’t tested it myself, a fruitier-smelling candle may be more attractive to fruit flies.

6. Place sticky traps in your home.

fruit fly trap diy yellow sticky pieces of paper with gnats tuck on them with green plants in background

Effective for killing gnats.

If you have a gnat infestation, these yellow sticky traps are perfect for taking out large numbers of them and can be used indoors or outdoors. The bright yellow color is irresistible for gnats, making them highly effective where indoor houseplants are located. Since they’re also made of eco-friendly material and are non-toxic, they are safe to have indoors or in outdoor garden areas. Wire ties are also included when you buy a pack of these traps which makes them easy to hang and use.

fruit fly trap in plant

You can also put them right at the source with ones made for soil. My Hip teammate Emily has these and loves how effective they are!

“These things are so amazing! We are currently dealing with an infestation of fungus gnats, and it’s terribly annoying and totally gross! I got these bad boys, and I am both delighted and disgusted because they catch so many gnats! I had no idea there were so many gnats in our house, but there they are. They just fly on over to the magic yellow sheet and keep getting stuck until the paper is literally black with gnats. AMAZING! And then you just replace the sticky sheet and watch with morbid fascination as gnats continue to fly to their sad little gnat deaths.” – Katie

Now that you know how to get rid of gnats and fruit flies, here are a few key things to do in your house so you’re keeping those nuisances away for good.

fruit fly trap diy bananas trash dishes green plant white window peaches brush light with white background

Ways to prevent fruit flies and gnats:

1. Keep your food clean. This goes for any fruits and veggies that might sit on your counter. As you’ve learned, gnats are attracted to a microscopic fungus that can be found on produce, so keep it clean.

2. Keep fruit sitting on your counter covered. You can do this with a jar or make sure to eat it before it starts to turn. The longer fruit sits out, the sweeter it gets, which will ultimately attract more fruit flies.

3. Take care of trash and dishes. If you have food and stinky garbage sitting around for long periods of time, fruit flies will be sure to find it, so make sure that your trash stays empty and your dishes are clean!

4. Replace poor-quality soil in houseplants. As you’ve already learned, poor quality soil can attract fungus gnats, so make sure you’re upgrading your soil when needed.

5. Keep entrances and windows properly sealed. Even with screens as protection, leaving doors and windows open allows for small gnats and fruit flies to make their way in, so keep them sealed.

6. Keep your lights off when it’s dark. Since gnats and fruit flies can be attracted to light, you’ll want to make sure you keep your doors and windows closed during dusk and when it’s dark out. This will help to keep from entering your house.

Check out this DIY shower cleaner!

About the writer:

Sara is a self-taught blogger & photographer and brings 9+ years of experience to her craft. Her work has been featured in numerous esteemed publications, spanning building, travel, and fashion. Beyond her creative pursuits, Sara’s primary mission is to empower others to embrace a toxic-free & sustainable lifestyle.

Join The Discussion

Comments 15

  1. Audra

    can gnats travel from apartment to apartment? I have done everything to get rid of these gnats, however I think a neighbor is infested with them and they are traveling? is this possible?

  2. Bre' Gant-Ussery

    Yes, I too live in an apartment. Haven’t lived in one since my freshman year at Texas Tech. I love the area here in San Marcos but it is full of life. I love the Texas State Life …. But the insects… NO! and this is my first time dealing with gnats, teetsy flies, fruit flies, Answering Your question: According to the pest control techs. The insects will keep trying your place as long as they are nearby. So a moment to study and fall asleep with your banana or strawberry smoothie might be just enough for the visits. I didn’t think I could hate. But GOD HELP ME I Hate their home invasion.
    The apple cider vinegar DIY seems to decrease their visits. Extra emphasis on making sure fruit and fruity things being out of reach. I might lose the fight but Im not gonna quit. Oh, Im gonna try the red wine too… If I “hafto” these words that only exist in olde school everyday use make me leary when I “haftah” spell them. 🙏GODS SPEED🙆

  3. Dee

    Another area to keep clean is your sink. I send the sink drain/stopper/basket through the dishwasher regularly and clean the drains with baking soda and vinegar. If you’ve taken all the fruit off your counter, this may be the place they are hanging out.

    • Amber (Hip Sidekick)

      Thanks so much for that helpful tip, Dee! Good to know!

  4. Cristine

    That ACV and dish soap trick is the best. Just used last week (my bananas went bad and flies got to them before I could throw them out). Amazing.

  5. Pam

    Unfortunately, the “plant or fungus” gnats are already in the potting soil when purchased from the store. Replacing the potting soil does not rid your home of the gnats. I bought different types of potting soil from different stores and still the gnats are present. I’ve used fly strips as well as the soap/vinegar solution. Some do get caught/die, but they rapidly multiply and are a nuisance. At one time, I had over 40 houseplants but had to get rid of them because of the gnats.

    • JonL

      Pam, Try using 1 part 3% hydrogen peroxide to 3 parts water when you water your houseplants or even before you use your potting soil. This formula will not only kill the bugs but also smothers the eggs and you won’t have to toss your plants.

  6. Maria

    Thank you for all the great ideas! But now where can I store my bananas?

    • Amber (Hip Sidekick)

      You’re welcome, Maria! It seems you can leave them on your counter for a bit until they get too ripe or real sweet when the fruit flies would be most attracted to them. Otherwise you could cover them. Hoping this helps!

  7. acgold

    If you water your houseplants from the bottom it helps. Just leave them in a dishpan or container of water until the water soaks through to the top. The roots will be watered and nothing left on top. We have about 15 plants that we have to bring in in the winter, and could not get rid of the gnats until we started watering from the bottom instead of the top. Nothing worked, ACV, hydrogen peroxide, dish soap!

  8. Jackie

    I have used the Apple cider vinegar trick for years and it works every single time.

  9. mamarenie

    I have tried all of these tips(minus number five) many times.. None work! I had to pitch around 60 house plants. So sad!
    I wish that I could get rid of them for good. My infestation started about 4-5 years ago from buying peaches from the peach company. Never again! I sent those peaches to my parents and my oldest in college and they have the same issues. I really don’t understand how they survive at my son’s place bc he leaves the first week of May and goes back the last week of August. It’s crazy!

  10. Casey

    My container is a soda bottle. I cut the top and flip it upside down and put in the bottle. The mixture is, apple cider vinegar and dish soap.

  11. Jess

    It honestly works just as well without the plastic wrap.

  12. Tricia

    The vinegar dish soap never worked for me. I recently bought a plug in light with a sticky trap back and I love it. Trapped alot of fruit flies and looks just like a nightlight.

Leave a Reply

Your email address will not be published. Required fields are marked *

It's not your Grandma's coupon site!

Sign up for a Hip2Save account (it's free) to access all of the awesome features!

Forgot Password?

Don't have an account? Register

Forgot Password

Don't have an account? Register

Become a Hip2Save Insider

Don't Miss Out! Join our large community of insiders - it's totally free! Once you join, you'll be able to save & share your favorite deals, rate posts and recipes and add items to your HipList and Cookbook! What are ya waiting for?!

Already have an account? Login

Thank you for rating!

Would you also like to leave us a comment?