In this guide
- Why Cleaning Beats Spraying
- Step 1: Find the Drain They’re Coming From
- Step 2: Scrub the Sink or Tub Drain (Including the Trap and Overflow)
- Drain-by-Drain Cleaning Guide
- Step 3: Use an Enzyme or Bacterial Drain Cleaner
- What Doesn’t Work (and Why)
- Dealing With the Adult Flies (and How Long It Takes)
- How to Keep Drain Flies From Coming Back
- When to Call a Professional
- Frequently Asked Questions
- The Bottom Line
Those tiny, fuzzy flies sitting on the bathroom wall aren’t coming from nowhere. They’re breeding in the slimy film inside one of your drains, and they’ll keep coming until that film is gone. This guide explains how to get rid of drain flies for good: finding the right drain, cleaning each type of drain properly, which products help, which fixes don’t, and how to keep them away.
Quick answer
Drain flies breed in the gelatinous organic film that coats the inside of drains, traps and overflows. To get rid of them, find the drain they’re coming from, then physically scrub the slime out with a stiff drain brush (snake the drain first if it’s slow, and clean the P-trap and overflow too). Follow up with an enzyme or bacterial drain cleaner used as the label directs, and run water through rarely used drains and toilets every week. Boiling water, bleach and bug sprays only give short-term relief because they don’t remove the film the larvae live in. Expect new flies to stop within about two to three weeks once the source is clean.
Table of Contents
Why Cleaning Beats Spraying
Drain flies (also called moth flies or filter flies) are small, gray, fuzzy flies with hairy, moth-like wings. If you’re not yet sure that’s what you have, our guide to fruit flies vs drain flies walks through identification in detail.
The reason drain flies are so persistent is where their young live. UC IPM explains that the larvae develop in the slimy organic matter coating sink and shower drains, and that eggs hatch in about 48 hours. The whole life cycle can take as little as 8 days or as long as 24 days, depending on temperature. The University of Kentucky puts it at about 10 to 15 days at around 70°F.
That’s why the experts agree on one thing: the fix is removing the breeding site. UC IPM calls chemical control “generally considered unnecessary” and says insecticides shouldn’t be used for drain flies in homes. Killing the adults you see does nothing about the next batch growing in the pipe.
Step 1: Find the Drain They’re Coming From
Cleaning every drain in the house is a lot of work. It’s faster to confirm which one is producing flies, then focus there. Often it’s just one.
- Start in the room where you see the most flies. UC IPM recommends checking every drain in that room, including tub, shower and floor drains.
- Look at the slime. UC IPM suggests removing the drain plate or stopper and scraping some of the slime with a dull knife to look for small, worm-like larvae.
- Trap emerging flies. Coat the inside of a clear cup with a thin layer of petroleum jelly or vegetable oil and turn it upside down over the drain. UC IPM suggests leaving it 24 hours; the University of Kentucky suggests several days. Flies coming out of that drain will stick to it.
- Try the tape method on floor drains and cracks. Texas A&M AgriLife suggests placing a strip of tape sticky-side down across a drain or a crack in the floor without completely covering the opening, then checking it for stuck flies.
If one test comes up empty, move to the next drain. The University of Kentucky notes that flies appearing for several weeks usually mean a relatively permanent breeding site.
Step 2: Scrub the Sink or Tub Drain (Including the Trap and Overflow)

The University of Kentucky calls cleaning pipes and traps to remove accumulated slime “the most effective control method.” Here’s how to do it thoroughly on a typical sink or tub.
- Protect yourself. Wear rubber gloves and eye protection, and put a bucket under the sink. If you’ve recently used a chemical drain opener, flush with plenty of water first (see the safety note below).
- Remove the stopper or strainer and scrub it separately; slime collects on the underside.
- Snake a slow drain first. UC IPM recommends clearing a slow drain with a plumber’s snake before cleaning, since a partial clog holds the organic buildup in place.
- Scrub the pipe walls. Work a stiff, long-handled drain brush up and down inside the pipe. UC IPM recommends a hard bristle brush; Penn State Extension mentions a stiff wire brush or steam. The goal is to strip the film off, not just rinse it.
- Clean the trap. The curved P-trap (or J-trap) under a sink holds water and slime, and UC IPM says to remove and clear it. Loosen the slip nuts, drain it into the bucket, scrub inside with a bottle brush, reassemble and check for leaks.
- Don’t skip the overflow. That channel stays damp and rarely gets rinsed. Run a narrow flexible brush into it.
- Flush well. Run water for a minute or two afterward. Texas A&M AgriLife suggests flushing scrubbed lines with boiling water; in plastic (PVC) pipes, a porcelain sink or a toilet, very hot tap water is the safer choice.
Safety note
Never mix drain products. Texas A&M AgriLife warns that rinsing with bleach after a caustic drain cleaner may produce chlorine gas. Use one product at a time, flush thoroughly in between, and keep the room ventilated. Don’t pour insecticides down drains either; the University of Kentucky advises against it.
Drain-by-Drain Cleaning Guide

Drain flies don’t only use kitchen and bathroom sinks. The University of Kentucky says larvae can live almost anywhere water stands for a week or more. Texas A&M AgriLife and UC IPM list several less obvious sites. Here’s how to handle each.
| Breeding site | Why flies use it | What to do |
|---|---|---|
| Sink, tub and shower drains | Soap, hair and skin build a slimy film | Snake if slow, scrub with a stiff brush, clean the trap and stopper (steps above) |
| Overflow openings | Damp and almost never flushed | Scrub with a narrow flexible brush, then flush with very hot water |
| Basement, garage or laundry floor drains | Water sits in the trap for long periods | Remove the grate, scrub the grate and pipe walls, pour water in weekly so the trap never dries out or stagnates |
| Rarely used toilets | Slime forms in the bowl and tank (University of Kentucky; Texas A&M) | Scrub under the rim and inside the tank with a toilet brush, then flush several times; flush weekly afterward |
| Refrigerator drip pan and icemaker lines | Standing water plus food residue | Pull out and wash the drip pan; check icemaker or condensate lines for leaks and pooled water |
| Garbage disposal | Food residue under the splash guard and in the drain | Turn off power at the switch or breaker, never put your hand inside, scrub under the rubber splash guard with a brush, then flush |
| Sump pits and elevator pits | Stagnant water and organic debris (UC IPM) | Clean out debris and keep the pump working so water doesn’t stand |
| Loose tiles, leaking pipes, crawl spaces | Hidden water collecting under tile, slabs or in crawl spaces | Fix the leak and dry the area; see when to call a professional below |
| Outdoors: AC condensate, clogged gutters, septic lines | Shaded pooled water and organic matter | Clear gutters, redirect AC drainage so it doesn’t pool, have a faulty septic line repaired |
Water collecting where it shouldn’t is worth fixing for more than flies. Our guides to crawl space moisture and signs of a water leak in a wall explain how to track the source down.
Step 3: Use an Enzyme or Bacterial Drain Cleaner
Once you’ve scrubbed, a biological drain cleaner helps break down the film that’s left in places a brush can’t reach. Penn State Extension describes bacterial and enzyme products that are poured around the lip of the drain or injected as a foam, and Texas A&M AgriLife notes that bacterial drain treatments biodegrade organic matter.
- Follow the label exactly. These products work gradually rather than instantly. If the label allows, apply them when the drain won’t be used for a while, such as overnight, so the product stays in contact with the buildup.
- Treat the overflow too, not just the main drain opening.
- Check septic compatibility. Texas A&M AgriLife advises checking whether a drain product is compatible with a septic system before using it.
- Keep using them for prevention. UC IPM says regular use of an enzymatic drain cleaner may help prevent the buildup that drain flies need.
An enzyme cleaner supplements scrubbing; it doesn’t replace it.
What Doesn’t Work (and Why)
A lot of popular advice gives a few quiet days before the flies return. Here’s what the extension sources say about common shortcuts:
| Method | What the sources say |
|---|---|
| Boiling water alone | UC IPM calls it a common misconception: it doesn’t remove the organic film and gives short-term control at best. The University of Kentucky agrees hot water may provide only short-term control. Useful as a rinse after scrubbing. |
| Bleach or ammonia | UC IPM says bleach doesn’t remove the film; Texas A&M AgriLife says there’s no benefit to treating drains with chlorine bleach or ammonia. |
| Caustic drain openers | Texas A&M AgriLife says caustic cleaners may not be as effective, and mixing them with bleach can produce chlorine gas. |
| Insecticides poured into drains | The University of Kentucky says not to do it, and UC IPM says insecticides shouldn’t be used for drain flies in homes. |
| Fly sprays and foggers | Texas A&M AgriLife describes pyrethrin aerosols as temporary control. They kill adults but not larvae in the drain. |
Texas A&M AgriLife notes that one insect growth regulator (hydroprene) is labeled for drains, but it doesn’t control adults and cleaning still comes first. Leave pesticide decisions to a licensed professional.
Dealing With the Adult Flies (and How Long It Takes)
Adults fade out once no new ones are emerging. Until then, the University of Kentucky suggests a fly swatter or a household flying insect spray used as labeled. A greased cup left over the cleaned drain catches stragglers and shows whether the drain is still producing flies.
Because the life cycle runs about 8 to 24 days (UC IPM), flies already developing can keep emerging for a while after you clean. Re-test the drain after a week; if flies still come out, scrub again or look for a second source. New flies should stop within about two to three weeks. If they don’t, the real source is somewhere you haven’t found yet.
Seeing other small bugs in the same bathroom? Silverfish love the same damp conditions; see our guide to silverfish in the bathroom.
How to Keep Drain Flies From Coming Back
A simple routine stops slime from rebuilding and water from going stagnant:
- Weekly: run water in guest bathroom sinks, tubs and floor drains, and flush seldom-used toilets. This keeps traps from going stagnant.
- Weekly: pull hair and debris out of stoppers and strainers, and flush kitchen and bathroom drains with very hot water.
- Monthly: use an enzyme drain cleaner on drains that have had flies before, and give the overflows a quick brush.
- Every few months: clean the refrigerator drip pan, check under sinks for slow leaks, and look at sump and floor drains.
- After travel: the University of Kentucky notes drain flies often appear after vacations, when water has stood still. Run every drain and flush every toilet when you get back.
- Outdoors: keep gutters clear and don’t let AC condensate pool in shady spots near the house.
When to Call a Professional
Most drain fly problems are solved with a brush and some persistence. Get help if:
- Flies keep coming after thorough cleaning of every drain. UC IPM notes that very large numbers probably mean a breeding site bigger than a few indoor drains, and that pipes in crawl spaces, wall voids and under slabs may need to be inspected for breaks or leaks. A plumber can camera-inspect lines you can’t reach.
- The source is out of reach, such as under a foundation or inside a wall. UC IPM recommends contacting a professional in that case.
- You smell sewage or see wet spots, which can mean a broken drain or sewer line.
- You run a food business. Penn State Extension notes that pest management companies offer drain cleaning as a service.
For other pests and how they affect your health, see our pest control at home guide.
Frequently Asked Questions
Does baking soda and vinegar get rid of drain flies?
Why do I still have drain flies after pouring boiling water down the drain?
Can drain flies come from the toilet?
Are drain flies harmful?
The Bottom Line
If you want to know how to get rid of drain flies for good, think plumbing, not pesticides. Find the drain they’re coming from with a greased cup or tape test, scrub the slime off the pipe walls, trap and overflow, and follow up with an enzyme cleaner. Then keep water moving through every drain and toilet each week. Boiling water, bleach and sprays only buy a few days. If the flies keep coming after a thorough cleanup, a hidden leak or broken pipe is the likely cause, and that’s a job for a plumber.
Sources
- UC Statewide IPM Program: Pest Notes: Moth or Drain Flies
- University of Kentucky Entomology: Drain Flies or Moth Flies (ENTFACT-615)
- Penn State Extension: Moth Flies in the Home
- Texas A&M AgriLife Extension: Drain Flies (Moth Flies or Filter Flies) (E-184)
