Gardening & Lifestyle

DIY: How Do I Get Rid Of Gnats

Find the source, knock down the adults, treat the larvae, and stop the cycle with easy DIY fixes that work in real homes and backyards.

By Jose Brito

Gnats can feel impossible because they show up in waves. You swat a few, set a trap, and two days later they are back on your sink or hovering over your houseplants. The trick is simple: you have to break their life cycle, not just kill the fliers you can see.

This guide walks you through a practical DIY plan you can start today, even if you are new to gardening or plant care.

Small gnats hovering above damp potting soil in a houseplant pot near a sunny windowsill

First, figure out what kind of gnat you have

People call several tiny flying insects “gnats.” The fix depends on where they are breeding. Here are the most common ones you will run into at home.

Fungus gnats (most common in houseplants)

  • Where you see them: hovering around pots, windowsills, and soil.
  • What causes them: consistently damp potting mix. Larvae often hang out in the top inch or two of the soil, where fungus and decaying organic matter are.
  • What they look like: tiny, dark, mosquito-like, weak flyers.

Fruit flies (often mistaken for gnats)

  • Where you see them: kitchen, trash, recycling, near fruit bowls.
  • What causes them: fermenting produce, spills, sticky bottles, compost pails.
  • What they look like: tan or brown, quick flyers, often on counters.

Drain flies (sink and shower culprits)

  • Where you see them: bathroom or kitchen near drains, especially mornings.
  • What causes them: organic slime inside drain pipes.
  • What they look like: small and fuzzy, kind of moth-like. They often rest on walls near drains.

Quick test (plants): Place a piece of clear tape sticky-side down over the soil surface of a suspect plant overnight (leave small gaps for air). If you catch multiple tiny black gnats, you are likely dealing with fungus gnats.

Quick test (drains): Cover the drain opening with clear tape overnight. If you find tiny flies stuck to the tape in the morning, that points to drain flies breeding in the pipe.

The DIY plan: stop adults and larvae at the same time

You will get the fastest results by doing two things for 10 to 14 days:

  • Trap or kill the adult gnats so they cannot lay more eggs.
  • Treat the breeding site (soil, drains, trash, or fruit) so larvae do not mature.

What success looks like: You may still see a few adults early on, even while the population is crashing. That is normal as the last batch hatches and then gets trapped or treated.

Step 1: Knock down the adults with simple traps

Yellow sticky traps (best for fungus gnats)

Sticky traps are low effort and very effective for catching adults around plants. Put one trap per pot for heavy infestations, or one trap for every couple of small pots if the issue is mild.

  • Insert traps close to the soil surface where gnats fly.
  • Replace when covered in bugs or dust.
  • Keep using them even after numbers drop. It helps you confirm the problem is actually gone.
Yellow sticky trap placed in a houseplant pot with potting soil

DIY apple cider vinegar trap (best for fruit flies)

This is the classic counter trap and it works well for kitchen flyers. It is not a reliable fix for fungus gnats from houseplants, which are usually more interested in damp soil than vinegar.

  • Add 1 to 2 tablespoons of apple cider vinegar to a small cup.
  • Add a drop of dish soap (this breaks surface tension so they sink).
  • Place near the problem area and refresh every couple of days.
Small glass cup with apple cider vinegar on a kitchen counter near a fruit bowl

Step 2: Eliminate fungus gnats in houseplants

If fungus gnats are your issue, the breeding site is usually the upper layer of moist potting mix. The goal is to make the soil surface dry and unfriendly, while targeting larvae already in the pot.

Let the top 1 to 2 inches of soil dry out

This one change often cuts the population fast. Fungus gnat eggs and larvae struggle in dry conditions.

  • Only water when the top layer is dry to the touch.
  • Empty saucers so pots do not sit in water.
  • If your plant hates drying out (like some ferns), you will rely more heavily on the treatments below.

Bottom-water for a couple of weeks

Bottom-watering keeps the soil surface drier, which discourages egg laying.

  • Set the pot in a tray of water for 15 to 30 minutes.
  • Remove and let it drain fully.

Use BTI to kill larvae (high success, beginner-friendly)

BTI (Bacillus thuringiensis israelensis) is a bacteria that targets mosquito and fungus gnat larvae. It is commonly sold as mosquito dunks or bits.

  • How to use: Soak bits or a portion of a dunk in water, then water your plants with that solution.
  • Soak time: Let it soak for about 20 to 30 minutes so the BTI disperses into the water.
  • Timing: Repeat weekly for 2 to 3 weeks to catch new hatchlings.
  • Why it works: It treats the larval stage, which is what keeps the infestation going.

Beneficial nematodes (effective biological option)

If you want another plant-safe option, beneficial nematodes (often sold as Steinernema feltiae) can be very effective against fungus gnat larvae. Apply according to the label directions and keep the soil lightly moist for the recommended window so they can do their job.

Hydrogen peroxide soil drench (use carefully)

A diluted hydrogen peroxide drench can help knock down larvae, but it is not my first choice because it can be harsh if overused and may stress sensitive roots.

  • Mix 1 part 3% hydrogen peroxide with 4 parts water.
  • Water the plant once with the mix, then let the pot drain.
  • Avoid frequent repeat treatments. If you want to be extra cautious, spot-test on a less valuable plant first.
  • Wait and observe. If the plant shows stress, stop and switch to BTI plus drying practices.

Top-dress the soil to discourage egg laying (optional)

Once you have started drying the soil and treating larvae, adding a barrier can help discourage adults from reaching the soil. Results vary, and it works best when paired with drying practices and BTI.

  • Options: coarse sand, horticultural grit, or fine gravel.
  • Depth: about 1/2 inch.
  • Note: If your mix already stays wet, a top layer can trap moisture. Skip it and focus on watering habits, drainage, and larval treatment.
Houseplant pot with a thin layer of coarse sand top-dressing over the soil

When repotting actually helps

Repotting is useful if the potting mix is old, staying soggy, or full of decomposing material.

  • Use fresh, well-draining mix.
  • Make sure the pot has drainage holes.
  • Avoid overpotting. A pot that is too large holds extra wet soil that dries slowly.
  • Empty cachepots and decorative outer pots so water does not pool out of sight.
  • Wash the pot before reusing it to remove eggs and residue.

Step 3: If gnats are coming from the kitchen

If you suspect fruit flies or you see most of the activity in the kitchen, focus on removing food sources and moisture. Traps help, but sanitation ends the problem.

Do a quick 15-minute kitchen reset

  • Throw out overripe fruit or store it in the fridge.
  • Rinse recycling, especially bottles and cans.
  • Wipe down sticky spots: under the toaster, around the trash can, under the fruit bowl.
  • Take out trash and scrub the inside of the can if you have residue.
  • Check mop buckets, sponge holders, and compost pails.

Keep the vinegar trap out for 3 to 5 days

Once you remove breeding material, the trap catches the last wave of adults.

Step 4: If they are coming from drains

Drain flies breed in the slimy buildup inside pipes. The goal is physical cleaning plus follow-up. Hot water alone rarely solves it without scrubbing.

Scrub and flush

  • Use a drain brush to scrub the inside of the drain and just into the pipe.
  • Flush with hot water. Boiling water can help, but be cautious with PVC, very old plumbing, and some sink materials that do not love thermal shock. When in doubt, use very hot tap water.
  • Repeat every other day for a week.

Use an enzyme drain cleaner (optional but helpful)

Enzyme cleaners break down organic buildup over time. Follow the product directions and apply at night so it sits longer.

Person wearing gloves using a small drain brush at a bathroom sink drain

What not to do

  • Do not rely on one vinegar trap while leaving wet potting soil untouched. Vinegar traps are mainly for fruit flies.
  • Do not keep watering on a schedule. Check the soil first. Most fungus gnat problems start with consistently damp soil.
  • Do not spray random bug spray indoors around edible plants or living spaces. It rarely solves the breeding problem and can create new issues.
  • Do not ignore the saucer. Standing water under pots is basically a gnat welcome mat.
  • Do not mix drain cleaners. Stick to one approach at a time and follow labels.

How long it takes

With the full plan (traps plus breeding-site treatment), you will often see a noticeable drop in 3 to 5 days, and a major improvement in 10 to 14 days. Results vary based on temperature, how many breeding sites you have, and how consistently you apply the plan.

If you are still seeing lots of gnats after two weeks, one of these is usually true:

  • There is another breeding source you missed (a different plant, a drain, trash, or compost).
  • The soil is still staying damp at the surface.
  • You stopped treatment too early and a new batch hatched.

Prevention that works

  • Water based on soil feel, not the calendar.
  • Improve drainage. Use pots with holes and a mix that does not stay swampy.
  • Give plants a better environment. More light and airflow helps pots dry at a healthier pace.
  • Quarantine new plants for a week. Many gnat problems come home from the store already started.
  • Use sticky traps as an early warning system. One trap near your plant cluster can tip you off before things explode.
  • Keep drains clean. A quick scrub and hot flush now and then helps prevent buildup.

Quick checklist

  • Identify the source: soil, fruit and trash, or drain
  • Set traps today (sticky traps and/or vinegar)
  • Treat the breeding site for 10 to 14 days
  • Dry the soil surface and stop standing water
  • Keep going one extra week after you think they are gone
Jose Brito

Jose Brito

I’m Jose Britto, the writer behind The Country Store Farm Website. I share practical, down-to-earth gardening advice for home growers—whether you’re starting your first raised bed, troubleshooting pests, improving soil, or figuring out what to plant next. My focus is simple: clear tips you can actually use, realistic expectations, and methods that work in real backyards (not just in perfect conditions). If you like straightforward guidance and learning as you go, you’re in the right place.

Share this: