How to Get Rid of House Flies and Keep Them Out

September 13, 2026

trash, trash cans, can, bin, garbage, container, waste, rubbish, recycle, recycling, basket, environment, disposal, environmental, trashcan, plastic, pollution, refuse, lid, bin, bin, bin, trashcan, trashcan, trashcan, trashcan, trashcan

Photo: pixabay · PIXABAY

Published Updated 3 min read

House flies breed outdoors, so the fix is outside your door, not on your fly swatter. Every fly indoors either walked in through a gap or hatched in something rotting nearby. Find the breeding material, clear it, then tighten screens and door sweeps so the next batch cannot follow.

Where House Flies Actually Come From

A female house fly lays eggs in moist, decaying organic matter. Not food exactly, and not garbage exactly, but anything wet and breaking down: the sludge at the bottom of a trash can, a pile of grass clippings, pet waste in the yard, spilled feed, an overripe compost heap, or a dead rodent under the deck.

The maggots eat there, pupate nearby, and emerge as adults. In summer warmth a whole generation can run from egg to flying adult in a week or two, which is why a small oversight in June becomes a kitchen full of flies in July.

That biology has one practical consequence. Adults you kill are the tail end of the process, and the pile that produced them is still producing. Nothing you spray indoors touches the maggots.

Telling House Flies From the Look-Alikes

Fly Where it came from What ends it
House fly Decaying matter outdoors Remove the source, seal the entry
Fruit fly Fermenting fruit and sink residue indoors Clear ripe produce, scrub the drain
Drain fly, fuzzy and slow Film inside a rarely used drain Scrub the pipe wall, run water regularly
Cluster fly, sluggish at windows Overwinters in wall voids, emerges in spring Seal gaps in fall, vacuum the strays
Blow fly, metallic green or blue Carcass, often in a wall or crawlspace Locate and remove the carcass

Sort this out before you clean anything, because each of these five sends you to a different room with different tools.

The Cleanup and Exclusion Order

  1. Walk the yard. Bag pet waste, turn or cover the compost, rake up wet clippings, and look under decks and shrubs for anything dead.
  2. Wash the trash cans, lids included, then dry them. Rinsed containers go in, wet food scraps go in a sealed liner.
  3. Move bins away from the door and keep lids latched.
  4. Clean indoors with intent: under the fridge, behind the stove, the recycling bin, and the pet feeding corner.
  5. Repair screens, add or replace door sweeps, and check where pipes and cables pass through exterior walls.
  6. Only after all that, deal with the adults still flying.

What to Do About the Flies Already Inside

Swatting is fine and so is a vacuum with a hose. Sticky ribbon hung out of reach quietly collects strays over a few days. An aerosol knocks down what it hits and then stops mattering, which is why professionals treat sprays as cleanup rather than control. Skip scented gimmicks and plastic water bags; neither one holds up.

Bait traps earn their keep in the yard, positioned downwind and far from the doorway, where they draw flies away from the house rather than toward it.

Signs You Have a Dead Animal Instead

Dozens of large, sluggish, metallic flies gathering at one upstairs window is not a garbage problem. It usually means something died in a wall, attic, or crawlspace, and the flies are emerging indoors. The smell may arrive after the flies, not before.

In that case the flies stop on their own once the carcass dries out, but the odor rarely does. Locating and removing it is the actual job, and a crawlspace or wall cavity is a reasonable point to bring in help.

Related reading