Drain flies are usually a sign that something slimy is growing inside a drain, overflow, trap, or unused pipe. The practical answer to how to get rid of drain flies is not a spray; it is a drain-cleaning routine that removes the biofilm they breed in and then keeps the plumbing from drying out or collecting new sludge. In this guide, I cover how to confirm the source, clean it properly, and tell the difference between a simple sink problem and a plumbing issue that needs repair.
Here is the quickest path to a drain-fly-free drain
- Drain flies breed in wet organic slime, not in the air itself, so surface sprays rarely solve the problem.
- First confirm which drain is producing them with a tape or cup test before you clean every sink in the house.
- Scrubbing the drain opening, overflow, and trap matters more than pouring in a one-time chemical.
- If flies keep returning from multiple fixtures, check for a dry P-trap, a leak, or an uncapped or damaged line.
- Weekly maintenance is usually enough after the breeding film is gone.
What drain flies are feeding on inside your plumbing
Drain flies are small, moth-like nuisance insects, but the real problem is not the adults you see on the wall. Virginia Tech Extension notes that they breed in the sludgy biofilm and standing water that builds up inside drains, filters, and sewers. That film is a mix of soap scum, grease, bacteria, hair, and decomposing residue, which gives the larvae exactly what they need.
This is why a sink can look clean from above and still keep producing flies. If the inside wall of the pipe is coated with slime, you are not dealing with a random insect problem; you are dealing with a plumbing hygiene problem. Once you understand that, the next step is figuring out which fixture is actually feeding the infestation.
How to confirm the source before you clean the wrong fixture
Not every drain fly comes from the sink you assume. I start by checking bathroom sinks, shower drains, tub overflows, floor drains, laundry drains, and guest bathrooms that do not get much use. A simple overnight test helps: cover the drain opening with clear tape, sticky side down, or place an inverted cup with a thin film of petroleum jelly over the opening. If adults are trapped by morning, that fixture is active.
- Check overflow openings on sinks and tubs, not just the visible drain hole.
- Look at floor drains in basements, laundry rooms, and utility spaces.
- Pay attention to drains that sit unused for weeks, because their trap water can evaporate.
- Watch for slow drainage, which usually means slime has built up inside the line.
If you find more than one active source, clean them all, but start with the worst one so you get faster results and a clearer read on whether the treatment is working. That leads straight into the part that matters most: removing the breeding film, not just the adults.

The cleaning method that removes the breeding film
The method that works is mechanical first and chemical second. I do not start with bleach or vinegar because they may reduce odors or kill some adults, but they usually do not remove the full layer of slime where larvae live. The goal is to strip the pipe walls clean enough that the flies no longer have a breeding surface.
- Remove the stopper and pull out visible hair and debris.
- Scrub the drain opening, overflow channel, and visible pipe walls with a stiff bottle brush or drain brush.
- If the trap is accessible, clean it thoroughly or have it removed and cleaned.
- Use an enzymatic drain cleaner or a foaming drain treatment if the pipe runs deep or has rough buildup.
- Flush with hot water after scrubbing to move loosened material out of the line.
- Repeat daily for 3 to 5 days, then switch to weekly maintenance until the flies disappear.
I avoid pouring boiling water into old PVC, brittle traps, or questionable glued joints. Hot tap water that your plumbing can handle is safer, and in most homes the brush does more work than the heat. For a persistent infestation, the EPA’s integrated pest management guidance also points back to routine drain cleaning where grease and organic debris collect, because the breeding site matters more than the adult flies you catch.
Once the film is gone, the population usually falls quickly, which leads to the next question: what if the flies keep returning even after a proper cleaning?
When the problem is plumbing, not just a dirty sink
If the flies return from several fixtures, I stop treating it like a single dirty drain. A dry P-trap, a cracked line, an uncapped pipe, or a leak inside a wall can keep feeding the insects even after the visible drain looks better.
| What you notice | Likely plumbing issue | Best next move |
|---|---|---|
| Flies from one bathroom sink only | Biofilm in that drain or overflow | Deep clean the drain, overflow, and trap |
| Flies from a rarely used floor drain | Dry trap seal | Refill the trap and run water weekly |
| Flies from several drains in one area | Shared buildup or hidden line issue | Inspect all connected fixtures and clean every branch |
| Slow drain plus sewer odor | Partial clog or damaged trap | Snake or clean the line, then inspect for damage |
| Flies near the wall or floor, not just the sink | Leak or uncapped pipe in a hidden space | Call a plumber for a line inspection |
One detail I pay close attention to is the trap seal. The P-trap is the curved section of pipe that holds water to block sewer gas and pests; if that water evaporates, the line becomes a pathway instead of a barrier. Refill unused traps with water, then keep them from drying out by running fixtures weekly or adding water to floor drains.
If you suspect a damaged sewer line or an uncapped branch pipe, home cleaning will not be enough. That is the point where a plumber or drain specialist saves time, because you want to fix the source instead of masking the symptom.
The maintenance routine that keeps the flies from coming back
After cleaning, run the suspect drains once a week, scrub the overflow every month, and keep rarely used traps wet. I also check any bathroom with a musty odor or a slow drain, because those two clues usually show up before the flies do. If the infestation was mild, adult activity often drops within several days; if conditions are warm and the breeding film was heavy, it can take 1 to 2 weeks to fully taper off.
- Run water through little-used drains at least weekly.
- Keep sink stoppers, strainers, and overflow holes free of hair and soap scum.
- Clean garbage disposals and nearby splash zones, which often stay damp and sticky.
- Use drain screens in showers and tubs to reduce fresh buildup.
- Fix slow drainage before it turns into a feeding site again.
The hidden channel behind the sink stopper matters more than most people expect, and it is often the difference between a short nuisance and a recurring infestation. If the flies return after 7 to 14 days of real cleaning, I stop assuming it is only surface grime and look harder for a hidden leak, uncapped pipe, or damaged trap seal.
The most reliable way to clear drain flies is to remove what they breed in, keep the traps wet, and treat recurring activity as a plumbing clue instead of a random pest event. If you handle the drain walls, the overflow, and the trap correctly, the problem usually stops at the source.