Drain flies breed in the slimy biofilm that coats the inside of your bathroom pipes, and the only way to get rid of them permanently is to remove that biofilm. Killing the adults you see on your walls and ceiling is satisfying but pointless if larvae are still feeding and growing inside the drain. A complete fix takes about two to three weeks of consistent cleaning, because the full life cycle runs 21 to 27 days.
Make Sure They’re Actually Drain Flies
Drain flies are about ⅛-inch long, light gray or tan, with fuzzy moth-like bodies and a dark border around their wings. They don’t zip around your kitchen like fruit flies. Instead, they clumsily flutter out of drains and land on nearby walls and ceilings, often sitting motionless for hours. If the tiny flies in your bathroom look more like miniature mosquitoes and hover near potted plants, those are fungus gnats. If they’re buzzing around fruit or trash, they’re fruit flies. The treatment for each is different, so getting the ID right matters.
Find the Source Drain
Not every drain in your bathroom will be infested. To test which one is the problem, place a strip of clear tape sticky-side down over each drain opening before bed. Leave a gap at the edges so air still flows (a completely sealed drain won’t attract flies upward). Check the tape in the morning. Any drain that has flies stuck to the underside is an active breeding site.
Common culprits include shower drains, bathtub drains, bathroom sink drains, and sink overflow holes. Floor drains that rarely get used are especially prone because stagnant water and organic buildup accumulate undisturbed.
Why the Biofilm Is the Real Problem
Female drain flies lay eggs on the surface of moist organic sludge inside your pipes. The larvae hatch in less than two days and then spend 9 to 15 days feeding on decaying organic matter, bacteria, fungi, and grease embedded in that slime. They breathe by extending tiny tubes through the biofilm’s surface, meaning they live inside it like a protective cocoon. This sticky layer is extremely difficult to wash away with water alone, which is why a quick rinse never solves the problem.
Adult flies live only a few days to about two weeks, but as long as the biofilm remains, new generations keep emerging. You can kill every adult in the bathroom today and see a fresh batch by the end of the week.
Step 1: Physically Clean the Drain
Mechanical removal is the most effective first step because it physically strips away the biofilm where eggs and larvae live. Here’s what works:
- Remove the drain cover and pull out any visible hair, soap scum, or debris by hand (wear gloves) or with needle-nose pliers.
- Use a stiff pipe brush or drain brush to scrub the inside walls of the pipe as far down as you can reach. Twist it as you push it in and out. You’re scraping off the slimy layer the larvae depend on.
- Follow with a plumbing snake or zip-it tool to dislodge buildup further down the line.
- Flush with plenty of water to wash loosened material through the system.
This is the step most people skip, and it’s the one that matters most. No chemical or home remedy works well without it, because the biofilm is a structured microbial layer with a protective matrix that resists chemical penetration.
Step 2: Follow Up With a Drain Cleaner
After brushing, a cleaning agent helps break down residual organic material you couldn’t reach mechanically.
Enzyme-Based Drain Cleaners
These are the best chemical option for drain flies specifically. They contain enzymes or bacteria that digest organic matter in the biofilm over time. The catch is that they work slowly and need repeated applications, typically once a day for one to two weeks. A single treatment from the drain opening can’t reach the full extent of buildup deep in the pipe, so consistency is key. Look for products labeled as “bio” or “enzyme” drain cleaners at any hardware store.
Baking Soda and Vinegar
Pouring half a cup of baking soda followed by one cup of vinegar into the drain creates a fizzing reaction that helps loosen buildup near the top of the pipe. It’s a reasonable option for minor infestations, but the solution becomes diluted as it travels deeper, so it won’t clear serious buildup further down the line. Think of it as a supplement to brushing, not a replacement.
What Doesn’t Work Well
Bleach kills adult drain flies on contact but does not penetrate the biofilm where larvae are embedded. You may see fewer flies for a day or two, then they return. Boiling water has the same limitation: by the time it travels through the drain body and into the pipe, the temperature has dropped significantly, and it contacts only a fraction of the biofilm surface. Neither addresses the larvae protected deeper in the system.
Step 3: Kill the Adults
While you’re working on the drain over the next couple of weeks, reducing the adult population prevents new eggs from being laid. A simple and effective trap: fill a shallow bowl with equal parts water and apple cider vinegar, add a few drops of dish soap, and set it near the problem drain. The soap breaks the surface tension so flies that land on the liquid sink and drown.
You can also swat or vacuum adults off walls and ceilings. A standard fly swatter works fine since drain flies are slow and clumsy fliers. These measures won’t solve the infestation on their own, but they reduce the number of egg-laying females while the drain cleaning takes effect.
Expect Results in Two to Three Weeks
Even after a thorough cleaning, you’ll likely see some adults emerging for the next week or two. That’s normal. Pupae already developing in the pipe take only 24 to 48 hours to emerge as adults, and any larvae you missed will continue maturing. The full life cycle runs 21 to 27 days at room temperature (faster in warmer conditions), so you need to outlast one complete generation.
Repeat the pipe brushing and enzyme treatment every few days during this period. If you’re still seeing new flies after three to four weeks of consistent cleaning, the breeding site may be somewhere you haven’t checked: a sink overflow hole, a floor drain under a cabinet, a leaking pipe behind a wall, or a condensation tray under an appliance. Occasionally, the problem originates in a septic system or a broken sewer line, which requires professional help.
Keeping Them From Coming Back
Drain flies return when the biofilm rebuilds, which it will over time in any drain that collects hair, soap, skin cells, and moisture. A few habits make recurrence unlikely:
- Run water regularly in every drain. Unused drains (guest bathrooms, basement floor drains) are prime breeding sites. Flush them weekly to keep the P-trap full and prevent stagnant buildup.
- Clean drain covers monthly. Pull hair and debris before it enters the pipe.
- Use an enzyme drain cleaner monthly. A single maintenance dose keeps organic buildup from accumulating to the point where it supports larvae.
- Install mesh drain screens to catch hair and soap chunks before they form the sludge layer that drain flies need.
The entire approach comes down to one principle: remove what the larvae eat and live in, and the flies disappear. Every other tactic, from traps to sprays to boiling water, is just buying time unless the biofilm inside your pipes is gone.