How to Get Rid of Gnats: Find the Source, End the Problem

eHow may earn compensation through affiliate links in this story. Learn more about our affiliate and product review process here.

How to Get Rid of Gnats: Find the Source, End the Problem

Gnats near your drains or hovering around houseplants call for different fixes. This guide walks you through how to get rid of gnats by identifying which pest you have, locating where it breeds, and clearing the infestation with methods that actually work. The treatment for drain flies won't touch a fungus gnat problem, and vice versa. A quick ID check changes everything that comes next.

Quick route if you're in a hurry:

  • Gnats near sinks, showers, or drains → start at Phase 1, Drain Flies
  • Gnats hovering around houseplants or flying toward windows → start at Phase 1, Fungus Gnats
  • Gnats in both places, or still present after three weeks of treatment → read the full guide; you likely have an unlocated breeding site

What you'll need before starting: A flashlight, clear tape, a stiff drain brush or metal pipe brush, and enzymatic drain cleaner for drain flies. For fungus gnats: yellow sticky cards and patience. No special tools required for outdoor fixes.


Advertisement

Phase 1: How to get rid of gnats in the house start by finding the breeding site

Video of the Day

Close-up of light gray, fuzzy drain flies resting near a sink and shower drain, illustrating how to identify drain flies before you learn how to get rid of gnats

The adults flying around your bathroom or potted plants are symptoms. The cause is wet organic material inside a drainpipe, inside potting mix, or in a damp corner of the yard where larvae are feeding and completing their life cycle. Every fix in this guide follows the same logic: find the source, remove it, then clear what's left.

Identify drain flies: Drain flies, also called moth flies or sink flies, are small (about ⅛ inch), light gray, and densely covered in fine hair that gives them a fuzzy, moth-like appearance, per Alabama Cooperative Extension. They fly weakly in short, stumbling bursts and rest on walls near sinks, shower stalls, and drains during the day. Nocturnal by habit, activity picks up after dark. Their wings are distinctly oval with parallel veins running the length of each forewing.

Identify fungus gnats: Fungus gnats are smaller, ranging from 1/16 to 1/8 inch, dark, long-legged, and mosquito-shaped, with light gray to clear wings bearing a Y-shaped vein pattern, according to University of Georgia Extension. They don't bite. You'll see them hovering low around potted plants or drifting toward windows. Their larvae live in the top one to two inches of potting mix and feed on fungi, algae, and organic matter; they sometimes feed on plant roots as well, and can stunt growth in young plants and seedlings.

Gotcha fruit flies are not gnats: Fruit flies are rounder, tan or amber-colored, and hover near overripe fruit, recycling bins, and open bottles. If that matches what you're seeing, this isn't the right guide.

A note on health risk: Drain flies don't bite or sting. Alabama Cooperative Extension notes they can potentially carry microbial pathogens from filthy breeding sites to surfaces they land on, though UF IFAS clarifies they are not capable of transmitting any known pathogens to humans. Large infestations may aggravate respiratory sensitivities due to fine scales shed from their bodies and wings, per UF IFAS.

Confirm the breeding site before touching anything:

For drain flies: Place a piece of clear tape sticky-side down over any suspect drain, leaving a small gap at one edge for airflow. Check it after 24 hours. Flies trying to emerge will be trapped on the underside. Both Alabama Cooperative Extension and UF IFAS confirm this as a reliable diagnostic. Test every drain in the house: bathroom sinks, kitchen sink, shower drain, bathtub drain, laundry floor drain, and the overflow holes on sinks. Slow drainage, bubbling, or foul odors are additional signals, per Alabama Cooperative Extension. If you find adults but can't locate a positive drain, check the base of toilet tanks, drip pans under appliances, damp mop storage, and dirty garbage containers.

For fungus gnats: Push a finger about an inch into the potting mix of any suspect plant. Consistently wet soil, not just moist, is the breeding environment. Press a small chunk of raw potato into the soil surface and check it in 48 hours; larvae are attracted to it and will be visible on the underside, per UC ANR. Yellow sticky cards placed at soil level near the pot will confirm adult activity.

Why speed matters: Drain flies can complete a full life cycle in as few as 8 to 24 days depending on temperature and humidity, with females laying up to 100 eggs, per Alabama Cooperative Extension. Fungus gnats cycle through a generation in a few weeks at typical room temperatures, with overlapping generations keeping numbers elevated, according to University of Georgia Extension. Leave one wet breeding site untouched and the problem continues.


Video of the Day

Phase 2: Eliminate the breeding site by source

Work through whichever track applies. If you have both pest types, work through both.

Drain flies indoor drains

Illustration of a person removing a drain cover and scrubbing the inside of a drainpipe with a metal pipe brush to remove dark slimy biofilm

Step 1: Mechanically clean the drain

Remove the drain cover, stopper, and trap. Use a metal pipe brush to scrub the inside walls of the drainpipe, targeting the dark, slimy biofilm where larvae live. UF IFAS describes this physical removal of organic material as the simplest and most direct control method. After scrubbing, apply an enzymatic drain cleaner or foaming drain treatment to break down buildup deeper in the pipe. Clean the stopper, pivot rod, and trap separately before reinstalling, as Alabama Cooperative Extension recommends cleaning all sink parts before putting them back.

Once the breeding site is gone, any adults still in the home can be vacuumed up or swatted. Sticky traps and UV light traps will reduce remaining adults but won't eliminate an active infestation they're a supplement, not a solution, per Alabama Cooperative Extension. Without a breeding site, remaining adults should fade out within two weeks; males live only a few days and females up to about a week, per UF IFAS.

Skip the liquid shortcuts: Pouring baking soda, bleach, vinegar, or boiling water into an uncleaned drain won't solve a drain fly infestation. Larvae live embedded in sticky biofilm that resists liquid, and adults have a water-repellent hair coating, per Alabama Cooperative Extension. That same source flags these methods as ineffective and potentially damaging to pipes. One nuance: UF IFAS recommends pouring boiling water after physically scrubbing to flush loosened material that's a follow-up step, not a standalone fix. Never pour insecticide down a drain. Never mix ammonia and bleach.

Step 2: Fix leaks, clear clogs, and disrupt standing moisture

Repair leaking pipes, dripping faucets, and slow-draining fixtures. Run water weekly through any drain that sees infrequent use a guest bathroom drain left dry for weeks accumulates biofilm and can become a breeding site, per Alabama Cooperative Extension. That same source recommends dehumidifiers in persistently damp spaces like basements and laundry rooms to reduce the ambient moisture that supports breeding conditions.

When to call a plumber: If you've cleaned every visible drain and the infestation continues, the breeding site may be inaccessible inside a wall void, beneath a shower pan, or in a buried leaking pipe. Alabama Cooperative Extension notes that locating hidden sources may require drilling into walls or slabs. That's a plumber's job, not a pipe brush's.


Fungus gnats houseplants

Person placing yellow sticky cards at soil level and setting raw potato chunks in potting mix to attract fungus gnat larvae and reduce adults

Step 3: Let the soil dry out

Stop watering until the top two inches of potting mix are dry to the touch. Overwatering is the primary reason fungus gnats take hold indoors. Dry soil discourages egg-laying females and makes it harder for newly hatched larvae to survive, according to University of Georgia Extension, which notes this approach often solves the problem on its own. The adult population should decline noticeably within one to two life cycles a few weeks at room temperature once you maintain consistent moisture reduction. If adults remain abundant after that window, at least one wet pot hasn't been identified yet.

Step 4: Empty saucers, isolate affected pots, and adjust watering habits

Pour out any standing water in saucers after each watering pooled water keeps the bottom of the mix saturated even when the surface looks dry. Keep infested plants physically separated from healthy ones; adult fungus gnats will move to the next available moist pot and lay eggs, per UC ANR. Soil type can compound the problem. NC State Extension notes that fungus gnats prefer potting mixes containing peat moss, while bark-based mixes are less attractive switching at the next repotting reduces susceptibility going forward. Worth knowing: that same source confirms fungus gnats are sometimes introduced in peat moss and plant plugs, so a new infestation isn't always your fault.

Step 5: Use yellow sticky cards and potato chunks to monitor and reduce adults

Place yellow sticky cards at soil level, on a small stick near the pot, not up at canopy height. This monitors whether the population is declining and removes some adults before they lay another round of eggs. University of Georgia Extension notes these are monitoring and reduction tools, not a cure. The raw potato method from Phase 1 pulls double duty here: larvae move to the potato instead of plant roots, per UC ANR, buying time while the soil dries. Check and replace the potato chunks every few days.

On insecticides for fungus gnats: Sprays are generally ineffective against adult fungus gnats, per University of Georgia Extension. If cultural control isn't working after a few weeks, a labeled soil drench can kill larvae. Insecticides are rarely needed, and UC ANR notes that most cases resolve without them.


Advertisement

Advertisement

Phase 3: How to get rid of gnats outside and stop them from coming back

Yard walkthrough illustration showing common outdoor breeding sites for drain flies and fungus gnats, including leaking irrigation lines, damp mulch, and algae-covered wet patches

This phase is primarily relevant to drain flies, which breed in septic systems, leaking pipes, wet compost, and standing water, and to fungus gnats in heavily mulched or irrigated beds. If the infestation was strictly indoors and the steps above have resolved it, what follows is maintenance.

Step 6: Audit and eliminate outdoor moisture sources

Walk the yard and check for leaking outdoor faucets or irrigation lines, standing water under garbage cans or rain barrels, algae-covered wet patches, and overly thick mulch. Alabama Cooperative Extension lists leaking garbage containers, damp compost, and wet soil under leaking pipes as common outdoor drain fly breeding sites. For fungus gnats in landscaping, NC State Extension recommends keeping mulch layers under three inches and not running irrigation on a fixed schedule that ignores actual soil moisture. Both reduce the persistent dampness these pests require.

Step 7: Seal entry points and adjust exterior lighting

Drain flies enter through gaps around windows, doors, and unscreened vents, drawn by interior light, per Alabama Cooperative Extension. If an outdoor breeding source can't be fully eliminated a shared septic system, for instance seal those gaps to reduce entry. That same source recommends switching outdoor lights to sodium vapor bulbs, which are less attractive to flying insects than standard white lights.

Step 8: Maintenance routine to prevent recurrence

Weekly:

  • Run water through any infrequently used drains
  • Check houseplant soil moisture before watering; let the top two inches dry between waterings

Monthly:

  • Scrub bathroom, kitchen, and laundry sink drains with a pipe brush and enzymatic cleaner, keeping drains and sink parts clean as Alabama Cooperative Extension recommends
  • Empty and rinse drip trays under all potted plants
  • Check outdoor faucets and irrigation lines for slow leaks

Seasonally:

  • Clear gutters; clogged gutters hold standing water and organic debris that drain flies will use, per Alabama Cooperative Extension
  • Inspect drip pans under refrigerators and washing machine drain hoses for moisture accumulation
  • Consider bark-based mixes for new plantings; fungus gnats can arrive pre-packaged in peat-heavy potting mixes, and NC State Extension confirms this as a known introduction pathway

Advertisement

If gnats persist: a troubleshooting checklist

  • Still seeing drain flies after two weeks of cleaning? Check every drain in the house, including overflow holes, toilet bases, and drip pans under appliances. One missed wet surface keeps the cycle going.
  • Still seeing fungus gnats after three or more weeks of reduced watering? Look for a pot you haven't dried out completely, or check saucers that may still be holding water underneath.
  • Adults persisting beyond a month despite addressing all visible sources? The breeding site is likely inaccessible. For drain flies, that means a buried or in-wall pipe leak. A licensed plumber can locate it; Alabama Cooperative Extension notes this may require drilling into walls or slabs.

The flying insects are the last thing to fix, not the first. Remove the wet organic matter they breed in and the rest takes care of itself.

Advertisement