Drain flies breed in the slimy biofilm coating the inside of your shower pipe, so the only way to get rid of them is to physically remove that film. Pull the cover, scrub the walls of the pipe with a long flexible drain brush, treat the walls, flush, and trap what is left. Most showers take 20 to 40 minutes the first time. Updated for 2026.
That is the whole trick, and it is where most advice goes wrong. Bleach, boiling water, and aerosol sprays kill the adults you can see and leave every egg and larva clinging to the pipe wall untouched. Two days later the same flies are back, and you are standing in the shower wondering what you did wrong.
What follows is the method I would hand a friend: mechanical removal first, a treatment that sticks to the walls second, and a trap and a test to confirm it worked. No product pitch, no caustic drain cleaner.
Table of Contents
What You Need
Gather everything before you start, because pulling a cover off mid-job with wet hands and no gloves is how people end up with a mess in the tub and a sore back.
- Rubber or nitrile gloves for the sludge. Wear them for every step, not just the first.
- A screwdriver or pliers if your drain cover is screw-in or has a snap fit.
- A long flexible drain brush or bottle brush, ideally 12 to 18 inches of bendable bristle. This is the single highest-impact tool in the whole job. A toilet brush does not reach.
- Old toothbrush, small scrub brush, or a stiff nail brush for the grate and the drain entrance where soap scum cakes on.
- Gloves, a small bucket, and a plastic bag or two to bag the debris. Hair mats hold moisture and smell; do not let them sit in the bathroom.
- Mild dish detergent and warm water for the first scrub. Optionally half a cup of baking soda for a deodorizing pass.
- An enzyme or biological drain gel that is labeled for drain flies, or a foaming biological cleaner. This is the step that lingers after the adults are gone.
- A small flashlight so you can see into the pipe. Bathroom lighting is a design choice, not a lighting choice.
- Apple cider vinegar, a few drops of dish soap, and a shallow dish or a cut bottle neck for the trap.
- Clear plastic wrap or a clean jar and petroleum jelly for the overnight test at the end.
Skip the aerosol insecticide. Anyone telling you to spray bug spray down a shower drain is creating fumes you then have to breathe in a small tiled room.
Two safety rules before you start
Never mix bleach with vinegar, ammonia, or any drain cleaner. Vinegar and bleach make chlorine gas. Boil-off from a mix sitting in a drain with no ventilation is a genuine injury risk, and it happens more often than people assume.
One chemical at a time, and give the drain a full rinse between products. If you use enzyme gel, do not follow it with bleach the same night, since bleach kills the bacteria doing the work. Cold water for the flush, then a soak overnight, then hot water later is the order that works.
Step-by-Step

Work in this order. Each step depends on the one before it, because you cannot treat a wall you have not exposed.
1. Remove the Shower Drain Cover
Take the cover off first. Look at the drain and identify its type: a screw-in strainer with one or two screws, a snap-fit or drop-in cover, a rubber or metal stopper with a lift tab, or a tile-insert grate that is grouted in place. The removal method is different for each, and forcing the wrong one is how people crack a grate or strip a screw head.
Screw-in strainers back out with a screwdriver. Stoppers lift straight up. A threaded stopper that refuses to turn is usually just soap scum around the threads, so work the screwdriver in the hole and turn the stopper itself. Never pry a grate with a flat tool, because the metal flange bends and then leaks.
You will know the cover is off when you can see the pipe wall and the water below it. Set the cover on a folded towel, not on the wet tub floor, and do not set it in the sink, because a wet metal cover leaves a ring.
2. Remove Hair, Soap Scum, and Debris
Lift out what you can reach. Put on gloves and pull out the visible sludge and the top layer of the hair mat with your fingers or the tip of the brush. This part is unpleasant and it is the part that matters most. A dense mat of hair wound around the entrance of the pipe holds water against the wall continuously, which is exactly the breeding condition you are trying to remove.
Bag it immediately. Hair mats stay wet for days and start smelling on their own, which is a whole separate problem you do not need.
Do not push debris deeper with the brush. It looks like progress, and it is exactly the opposite. If the brush will not move freely, the blockage is further down, and that is where a real blockage belongs instead of on your hands.
3. Clean the Drain and Trap
Scrub the walls, not just the opening. This is the step the internet skips and the step that decides whether the flies come back. Feed the flexible brush down the pipe, rotate it, and work the bristles against the full circumference as far down as the brush reaches. The film that matters is the film stuck to the side walls, and it is slick rather than loose, so you need real friction and a detergent to lift it.
Put a squirt of dish detergent down first and let it sit for five minutes. It gives the bristles something to work with. Then scrub.
Do the same on the underside and edges of the cover, the drain entrance, the hair catcher if you have one, and the grate slots. Soap scum on the grate is a small farm of its own.
If you can see the water seal, scrub below it too. The P-trap, that U-shaped bend under the drain, holds a layer of sludge at the bottom of the trap, and the larvae cling to that layer where a flush barely touches it. Clear what you can reach without dismantling anything.
Know where to stop. If the brush meets resistance a few inches in, if the water sits high after a brief flush, or if the drain does not drain at all, the problem is a plumbing blockage and not a biofilm. At that point you need a plumber. Unscrew fittings under a sink or a shower pan and you are now in a project with a real chance of a leak, which is a bad trade for a fly problem.
4. Rinse the Drain Carefully
Flush with hot tap water, and use boiling water only with care. Run the shower for three to five minutes with the brush working in the drain the whole time so the loosened film goes downstream instead of settling back down. Let the water sit a few hours first if the buildup was heavy, because a thick mat often needs to rehydrate before it moves.
A kettle of boiling water down the drain is a popular move and it is not harmless. On old cast iron or in a home with brittle acrylic or a thin-wall plastic trap, repeated boiling water can crack or warp the fitting. On new PVC it is usually fine, but it also does very little on its own: heat kills what it touches at the surface and does nothing to the eggs and larvae attached a few inches down the wall. Boiling water is a rinse, not a treatment.
After the flush, add the treatment. Pour the enzyme or biological gel slowly and let it sit for the label time, usually overnight, with the drain covered. The point of a gel over a liquid is contact time on the walls. A biological cleaner foams up, sits in the trap, and digests the organic film over hours rather than dissolving it in thirty seconds, which is why it keeps working after the adults are gone.
A dry half cup of baking soda poured down, followed by a slow pour of white vinegar, will foam and help break up light grease and soap residue. It is a decent deodorizer and a weak treatment. Use it for maintenance, not for an active infestation, and never pour it in the same hour as bleach.
5. Dry the Shower and Check for More Breeding Sites

Dry it, then go looking for the real source. Wipe the drain and the pipe walls dry with an old towel, run the exhaust fan, and leave the shower door open. A wet drain re-forms biofilm in days, and a humid shower is what tells the flies the location is good.
Then check the places nobody thinks about. A linear shower drain is a trough, not a pipe, and the film settles in the low channel along its length. Lift the grate, scrub the channel, and check the outlet end, which is where the biofilm collects when water drains. Tile-insert channels have no removable grate at all, so you clean through the slot with a narrow brush and a rag.
Look at the overflow plate inside the tub or shower wall, and the bathroom floor drain if the bathroom has one. Both trap water and both go unseen for years. In a basement, check the laundry drain, a floor drain, and any utility sink within a few feet of the bathroom. A wet mop bucket that never fully empties can keep a small population alive on its own.
Fix or report any drip, a slow shower drain that leaves standing water, or a leaking trap. If flies keep appearing and the shower pipe is now clean, the source is somewhere else in the building.
If you rent, and the flies are in a shared stack
Apartment and condo units drain into a shared vertical stack, which means your next-door neighbor’s shower can reseed your pipe and vice versa. If that is your situation, cleaning your own drain is worth doing, but do not expect it to end the problem on its own, and do not keep repeating the treatment on a schedule that never works.
Work out where the flies are actually coming from before you contact anyone. Note the dates you see them, whether they appear during or after a shower, which room they show up in, and whether the flies appear at the ceiling above the bathroom rather than near the drain. That last one confuses people constantly: the flies travel up the pipe and out through a bathroom vent or an overflow route, so where they land tells you little about the source. Photograph what you find when you lift the grate, including any dark gelatinous film and the little worm-like larvae, and keep the debris in a sealed bag. A short dated timeline with photos is far more effective than a description of flies that are no longer there when someone visits.
6. Prevent Drain Flies From Returning
Make the drain a bad place to live, on a schedule. Once a week, run very hot tap water for a couple of minutes with the strainer off so it carries biofilm down rather than letting it set. Once a month, scrub the pipe with the brush and apply a biological drain gel. After every shower, wipe the drain opening and the grate dry, and run the exhaust fan for ten minutes or leave the door cracked.
Keep a drain hair catcher in the mouth of the drain. It stops the bulk of the hair that starts the mat, which is worth more than any treatment. Clean it out every week or it becomes the thing it was meant to prevent.
Fix leaks and slow drains the week you notice them. If a guest shower or spare bath goes unused for weeks, the trap dries out and the water seal breaks, and then sewer gas rises and dry traps collect dust and hair. Run the shower briefly once a week, or pour a bucket of water down it, to keep the seal intact.
Watch for the seasonal version of this. Warm, humid weeks and stretches where guests are staying in the house are when people notice them most, because the shower is running more often and the air is holding more moisture.
What to expect, and when to stop
Nobody is going to promise this is done overnight, and anyone who does is selling something. Here is a realistic shape to it.
Day one: the flying adults are still around for a few hours after treatment, and you may still see a few the next morning. This is normal. A gel treatment works on contact with the film, not on flying insects.
Day three: noticeably fewer adults. If you are still seeing the same number, either you missed a breeding site or the biofilm in the trap is still feeding a batch of larvae that had already hatched.
Day seven: the visible activity should be down to almost nothing. Look for larvae, not flies: a flashlight and a clear jar are far more informative than counting flies at the ceiling.
Day fourteen: if a fresh batch of adults is still appearing, something is still wet and still breeding. Go back to step five and check the overflow, the floor drain, the linear channel outlet, and the traps on other fixtures.
To confirm you are finished rather than guessing, seal the drain overnight. Stretch clear plastic wrap tightly over the drain and secure it with tape, or set a clean jar upside down over the drain with its rim coated in petroleum jelly so nothing can climb out. If you lift it in the morning and the wrap is dry and nothing is stuck to it, the drain is quiet. Finding adults trapped against the wrap tells you exactly where they are still coming from.
Common Mistakes
Almost every failed attempt traces back to one of these.
Pouring bleach down the drain. Bleach kills the adults near the surface and the loose film in the trap, then it goes down the line with everything else. It does not strip the attached film from the pipe wall, and it leaves no residual protection, so a colony rebuilds within days. Repeated bleach use also corrodes older metal pipe. Fix: scrub the wall physically, then use a gel or biological treatment that stays in contact with the pipe.
Pouring boiling water and calling it done. It scald the surface film and leaves the eggs. It can also soften or crack an old trap or a thin acrylic fitting. Fix: use hot tap water as a rinse after scrubbing and save boiling water for an occasional deep rinse at most.
Baking soda and vinegar as the main attack. They foam nicely and smell better for a day, which feels like progress. The reaction mostly neutralizes itself, and neither one removes film. Fix: use it between treatments to keep the drain smelling fresh, not instead of a treatment.
Spraying aerosol insecticide down the drain or into the room. You kill adults, the larvae survive, and you inhale the fumes in a small wet room. Fix: trap adults instead, using apple cider vinegar and a drop of dish soap in a shallow dish, or a cut bottle neck. The soap breaks the surface tension so the flies cannot stay on the liquid.
Swatting the flies or killing them by hand. Unsatisfying, and it changes nothing, because the adults you kill are the least of the problem. The population lives in the pipe. Fix: treat the drain, then trap.
Cleaning one drain and assuming you are done. In a home with a floor drain, an overflow, a tub, or a second bathroom, you may have fixed one of four sites. In an apartment, the shared stack means the source can be in a unit you cannot see. Fix: check every drain in the bathroom and the ones next door, and if flies appear from more than one drain, treat it as a building-level problem.
Leaving the shower wet and dark after cleaning. A damp, poorly ventilated shower is the habitat, not just the location. Fix: dry the drain, run the fan, and keep the habit of wiping the drain opening after use.
Frequently Asked Questions
What are drain flies in a shower?
Drain flies, also called moth flies or sewer flies, are tiny moth-like flies about 1/8 inch long that breed in the slimy biofilm inside shower, tub, and sink drains. Adults lay egg masses on the wet film, and the larvae feed on it until they pupate and hatch. The adults you see flying are the small share of the population; the rest is living on the pipe wall.
Will bleach get rid of drain flies?
Not on its own. Bleach kills adult flies near the drain and loosens surface film in the trap, but it runs straight down the line without stripping the biofilm clinging to the pipe wall where the eggs and larvae sit. Because it leaves no residual action, flies usually return within a few days. Scrub the walls first, then use an enzyme or biological gel, and save bleach for disinfecting surfaces.
Why are drain flies coming back?
Four reasons are common. The biofilm was never physically removed, only rinsed. The source is a different drain, an overflow plate, a floor drain, or a linear shower channel you have not opened. A leak or slow drain keeps the pipe wet enough to breed. Or you live in a multi-unit building and the stack is shared, so a neighboring unit keeps reseeding the line. Test each drain separately to find out which one it is.
Are drain flies harmful to people?
They do not bite, sting, or burrow, and they are not known to transmit disease to people. The concern is hygiene rather than injury. Their larvae live in organic sludge, and bacteria in that biofilm can be carried to food or bathroom surfaces, so cleaning the drain is worthwhile on its own. People with asthma or allergies may notice irritation from the flies and from the smell, and heavy infestations usually mean a drainage problem worth fixing.
Can I pour boiling water down the shower drain?
You can, and on newer PVC plumbing it is usually safe as an occasional rinse. But it is not a treatment. Heat only reaches the surface, so eggs and larvae attached further down the wall survive, which is why people keep pouring it and keep seeing flies. On older cast iron, thin-wall plastic, or acrylic fittings, repeated boiling water can crack or warp the trap. Scrub the walls first and use hot tap water for the flush.
When should I call a plumber for drain flies?
Call a plumber when the brush meets resistance a few inches into the pipe, when the shower drains slowly or holds water, or when the trap area leaks. Those are blockage or fitting problems that a brush cannot fix. Call a pest professional instead when flies keep coming from more than one drain, when the drain pipe is clean and the flies still appear, or when they show up in several units at once, since that points to a shared stack or a vent line.
Conclusion
To get rid of drain flies in a shower, start with the physical work: pull the cover, bag the hair mat, scrub the pipe walls with a long flexible brush and dish detergent, and flush until the water runs clear. Then treat the walls with an enzyme or biological gel and leave it overnight.
Dry the shower afterward, and if the flies still show up, look past the drain. Check the linear channel, the overflow, the floor drain, the laundry drain, and any leak that keeps the pipe damp. In an apartment, test the drains in neighboring units before you clean yours a fourth time, and keep notes if you need your landlord to act.


