How to Get Rid of Fruit Flies and Gnats

Stop fruit flies and gnats fast with DIY traps, drain cleanouts, and simple prevention. Learn where they breed, how to tell fruit flies from drain flies and fungus gnats, and how to keep them from coming back.

Marcus Vance

By Marcus Vance

DIY Expert & Contributor

A real kitchen countertop with a small bowl of bananas and a few tiny fruit flies hovering near the fruit, natural indoor light, photorealistic

When you suddenly notice tiny flies doing laps around your fruit bowl or sink, it feels like they appeared out of thin air. They did not. Fruit flies, drain flies, and fungus gnats all reproduce fast, but they only explode in numbers when there is a moist, food-rich breeding spot nearby.

The good news is you can usually knock down an outbreak in about 7 to 10 days if you do two things: reduce the adults (traps) and remove the nursery (the breeding source). If you only do traps, you will keep catching flies while the next generation keeps hatching.

Quick safety note: Keep traps and cleaners away from kids and pets, ventilate when using products, and never mix cleaners (especially bleach with anything acidic).

First, figure out what you are dealing with

“Gnats” is a catch-all word, but the fix depends on which bug is in your house. Here is the homeowner-friendly ID guide.

Fruit flies

  • Where you see them: around produce, recycling, trash, beer or wine, sticky spills, and sometimes around the sink.
  • What they want: fermenting sugars. Overripe fruit is the classic, but they also love residue inside cans and bottles.
  • Clue: they tend to hover near food and land on fruit, counters, and cabinet faces.

Drain flies (moth flies)

  • Where you see them: on bathroom or kitchen walls near sinks and tubs, right around drain openings, or resting on the underside of a sink rim.
  • What they want: slime in drains. That gunky biofilm inside the pipe is a buffet and nursery.
  • Clue: they often look fuzzy or moth-like and do short, fluttery flights.

Fungus gnats (houseplant gnats)

  • Where you see them: near houseplants, on windows, around potting soil, and sometimes near desk lamps at night.
  • What they want: damp soil and decaying organic matter in the pot.
  • Clue: when you water a plant or bump the pot, a few will pop up from the soil.

Not sure it is one of these?

If the flies seem to run fast on counters more than they fly, look kind of humpbacked, or keep showing up around a sink despite cleaning, you may be dealing with phorid flies. They are often tied to drains, leaks, or hidden plumbing issues. Also, if you are getting bites or the insects are larger and clustering at windows, you may have something else entirely.

Quick test: Put a small cup trap near the suspected source for one night. If the cup near the fruit bowl catches most of them, you are likely dealing with fruit flies. If the cup near the sink wins, think drains. If the cup near the plant wins, think fungus gnats.

Where they breed in a typical home

A close-up real photo of a stainless steel kitchen sink drain with visible water droplets and a slightly dirty drain opening, sharp focus, photorealistic

1) Overripe fruit and forgotten produce

This one is obvious, but it is also sneaky. One banana that crossed the line, an onion bag in the pantry, or potatoes in a dark cabinet can fuel a whole population.

2) Recycling and trash residue

Fruit flies do not need a whole apple. A tablespoon of sweet residue at the bottom of a can, kombucha bottle, juice jug, or wine glass is plenty.

3) Sink drains and garbage disposals

Even if you keep a tidy kitchen, drains collect biofilm. That slime layer is the classic breeding zone for drain flies. Fruit flies can also breed in drains when organic sludge and food bits build up in the trap or disposal (not usually in a truly clean drain).

4) Houseplant soil

Fungus gnats lay eggs in the top layer of damp potting mix. Overwatering and poor drainage keep the top inch wet, which is exactly what they want.

5) Mop buckets, wet rags, and hidden spills

Check the bottom of your kitchen trash can, under the recycling bin, and under the fridge. A sticky spill that never fully dries can keep the cycle going.

Fast knockdown: DIY traps that work

Traps will not solve the problem alone, but they are the fastest way to cut down the adults while you clean up the source.

Apple cider vinegar and dish soap trap (best all-around)

A small glass bowl on a kitchen counter filled with apple cider vinegar and a drop of dish soap, covered loosely with plastic wrap with a few small puncture holes, photorealistic indoor lighting
  • Pour 1 to 2 inches of apple cider vinegar into a small bowl or cup.
  • Add 2 to 3 drops of dish soap. Do not stir aggressively, just swirl. The soap breaks surface tension so flies sink.
  • Optional: cover with plastic wrap and poke a few small holes. This reduces odor and helps guide them in.
  • Set it right at the hotspot: next to the fruit bowl, near the trash, or beside the sink.

My thrifty tip: If you are out of apple cider vinegar, use red wine, old beer, or even a splash of fruit juice with a bit of vinegar mixed in. The key is a fermenting smell plus soap.

Paper cone jar trap (when you want less smell)

  • Put a little vinegar or wine in the bottom of a jar.
  • Roll a piece of paper into a cone and place it in the jar with a small opening at the bottom.
  • Flies go in, then struggle to find their way out.

Sticky traps for fungus gnats

For fungus gnats, yellow sticky cards placed at soil level catch adults well. They are not glamorous, but they work, and they help you measure progress.

Drain treatments that remove the breeding layer

If you suspect drain flies or you keep catching flies near the sink, treat the drain like a mini project: clean first, then break down what is left behind.

Step 1: Scrub the drain and overflow

A hand wearing a rubber glove using a long flexible drain brush to scrub inside a bathroom sink drain, close-up, photorealistic
  • Pull out the stopper and clean hair and gunk.
  • Use a long drain brush or an old bottle brush to scrub the inside walls of the drain opening.
  • Do not forget the overflow hole in bathroom sinks. That hidden channel can be gross and can hold biofilm.

This is the part most people skip. But biofilm is the nursery. Liquids do not always penetrate a thick slime layer.

Step 2: Flush with very hot water (carefully)

  • Boil a kettle and pour slowly into the drain in two rounds.
  • Skip boiling water if you have plastic piping (like PVC), older joints, fragile fixtures, or any history of drain issues. Use very hot tap water instead.

Step 3: Use an enzyme drain cleaner for 5 to 7 nights

For ongoing drain fly problems, an enzyme-based drain gel is a solid DIY choice because it is designed to break down organic buildup (the slime layer). Follow the label and apply at night so it sits in the pipe longer.

Avoid this combo: Do not mix vinegar with bleach or other cleaners. Pick one method and stick with it. If you are unsure what is already in the drain, flush thoroughly with water before using another product.

Step 4: Check for a plumbing issue if they keep coming back

If you have persistent drain flies (or possible phorid flies) even after a week of cleaning, look for:

  • A rarely used floor drain with a dry trap (add water to refill the trap)
  • A slow leak under the sink creating constant moisture
  • A gunky garbage disposal that needs a deeper cleaning
  • Sewer odor, recurring backups, or flies emerging from cracks near plumbing (call a plumber sooner)

How to get rid of fungus gnats in plants

Fungus gnats are more of a plant care issue than a kitchen sanitation issue. You can trap adults all day, but the larvae are in the soil. Here is the plan that works for most homes.

Step 1: Let the top 1 to 2 inches of soil dry

Most common houseplants can handle a slightly drier cycle than we think. The goal is to make the top layer unfriendly to eggs and larvae.

Step 2: Fix the “wet feet” setup

  • Empty saucers after watering.
  • Make sure pots have drainage holes.
  • If the soil stays soggy for days, consider repotting into a better draining mix.

Step 3: Use sticky traps to catch adults

Place yellow sticky traps near the soil surface. Replace when covered with dust or bugs.

Step 4: Treat the soil if needed

If you have a heavy infestation, you can knock down larvae with one of these:

  • BTI (mosquito bits or dunks): soak in water and use that water for the plant. This is one of the more targeted, plant-friendly options.
  • Hydrogen peroxide mix (optional): a common DIY is 1 part 3% peroxide to 4 parts water as a one-time soil drench. Results vary, and it can stress sensitive plants or soil biology, so test on one plant first and do not make it your weekly routine.

Kitchen cleanup checklist that ends fruit flies

A real photo of a clean kitchen counter next to a sink with a sponge and a closed trash can in the background, bright natural light, photorealistic

If you want the problem gone, this is the unglamorous part that makes the traps actually work.

  • Remove ripe produce from the counter. Refrigerate it or toss it.
  • Check hidden produce: pantry onions and potatoes, fruit in lunch bags, compost pails, and the bottom of the fruit bowl.
  • Rinse recycling or at least cap and bag it. Pay attention to beer cans, soda cans, wine bottles, and kombucha.
  • Wash the bins: clean the inside bottom of the trash and recycling can, plus the rim and lid where residue hides.
  • Wipe sticky zones: under the toaster, coffee station drips, around syrup or honey, and around the trash can rim.
  • Empty the trash nightly for a week during an outbreak.
  • Clean the disposal: run hot water, a little dish soap, and scrub the rubber splash guard where gunk hides.

In my own house, the surprise culprit was a “clean looking” recycling bin that had a little sweet sludge in the bottom. I kept trapping adults and feeling proud, then they would be back two days later. Once I washed the bin with hot soapy water, the outbreak finally collapsed.

Prevention tips that work

Once you break the cycle, prevention is mostly about removing easy food and keeping moisture zones from getting slimy.

  • Store fruit smart: let fruit ripen on the counter if needed, then refrigerate once ripe, especially bananas and stone fruit in summer.
  • Run a quick sink reset nightly: rinse food bits, run the disposal with water, and wipe the drain area.
  • Keep drains fresh: once a week, scrub the drain opening and flush with hot water. This matters more than people think.
  • Do a plant check: if you see gnats, cut back watering and empty saucers.
  • Seal and take out compost: use a container with a tight lid, empty it often, and wipe the lid and rim where goo collects.
  • Fix leaks: even a slow drip under a sink keeps humidity and grime in the exact place flies prefer.

FAQ

How long does it take to get rid of fruit flies?

If you remove the breeding source and run traps, most outbreaks noticeably improve in 2 to 3 days and are often mostly gone in about 7 to 10 days. Heavy infestations can take longer. If they linger, you missed a source, often a drain, recycling residue, compost, or a forgotten piece of produce.

Why do I still have gnats even though my house is clean?

Because “clean” can still be moist and food-adjacent. A clean-looking drain can have biofilm. A tidy plant corner can have constantly damp soil. A rinsed bottle can still have residue inside the neck.

Do plug-in blue light traps work?

They can reduce flying adults, especially at night, but they rarely solve the root cause. I treat them like a helper, not the main plan.

When should I call a pro?

If you have tried source removal plus drain or soil treatment for 7 to 10 days and still see heavy activity, consider calling a pest pro. Also call a plumber if you suspect a broken drain line, chronic sewer odor, flies coming from cracks, or repeated backups.

The simple game plan

If you are overwhelmed, do it in this order:

  • Night 1: set vinegar and soap traps at the top two hotspots.
  • Day 2: throw out or refrigerate ripe produce, rinse recycling, wipe sticky spots, empty trash.
  • Night 2: scrub and flush drains, then start an enzyme drain cleaner if needed.
  • Days 3 to 10: keep traps running and keep the source dry and clean until the population collapses.

That is the whole trick: trap the adults and starve the next generation. Once you do both, these little pests stop feeling mysterious and start feeling manageable.


Marcus Vance

About Marcus Vance

Content Creator @ Grit & Home

Marcus Vance is a lifelong DIY enthusiast and self-taught home renovator who has spent the last decade transforming a dilapidated 1970s ranch into his family's dream home. He specializes in budget-friendly carpentry, room-by-room renovations, and demystifying power tools for beginners. Through his writing, Marcus shares practical tutorials and hard-learned lessons to help homeowners tackle their own projects with confidence.