How to Get Rid Of Flies

Flies are not complicated creatures. They eat rotting things, lay eggs in rotting things, and generally make themselves at home wherever you’ve been sloppy about sanitation. That’s the whole story. Which means getting rid of them is mostly about removing what they want – the breeding sites, the food sources, the gaps in your defenses – rather than chasing individual flies around the room with a rolled-up magazine.

That said, flies show up in different places for different reasons. A fruit fly cloud hovering over your kitchen counter has a different cause than the houseflies battering themselves against your living room window, which is different again from the swarm that appears every time you open the back door in summer. The solutions overlap, but not completely. This page covers the full picture: how flies get in, what’s drawing them, and which approaches actually work depending on where you’re dealing with them.

The short version: kill the source first, then deal with the ones already inside. Traps and zappers without source removal is a treadmill. You’ll catch a hundred flies this week and a hundred more will hatch next week.

Traps and Zappers

Sometimes you just need to reduce the immediate population while you work on the actual problem. Traps are good for this. They don’t solve anything by themselves, but they’re satisfying and they give you a faster result than sanitation work alone.

Apple cider vinegar traps are the go-to for fruit flies – pour a small amount into a jar, add a drop of dish soap (breaks the surface tension so they sink), and cover loosely with plastic wrap poked with a few holes. They’ll find it. An improvised trap like this outperforms most of the fancy commercial ones.

Sticky traps work for a broader range of fly species. The yellow ones are particularly effective because flies are attracted to yellow. Hang them near windows, near trash cans, near compost – wherever flies congregate. They’re ugly. They work.

Bug zappers handle flying insects outdoors and in garages reasonably well. Indoors, they’re noisy and they spread tiny fragments of dead insects around, which is arguably worse than the flies themselves. For outdoor use on a patio or deck, they’re effective.

Fly swatters – the manual kind and the electric kind – are for the stubborn single fly that somehow survived everything else. The electric version (a racket that delivers a small shock) is faster and doesn’t require the precision of a manual swat. Both are legitimately useful to have around.

Natural Repellents

Flies dislike certain smells intensely. This is useful. You can exploit it without any chemistry more dangerous than what’s already in your kitchen cupboard.

Essential oils – eucalyptus, lavender, peppermint – repel flies when the concentration is high enough. A diffuser running in a room helps. A spray made from 10-15 drops of essential oil per cup (240 ml) of water, spritzed around windows and doorways, does too. Don’t expect it to clear an infestation on its own, but as a layer of prevention it’s real.

Bay leaves are one of those traditional tricks that actually has something behind it. Fresh or dried bay leaves near fruit bowls, in pantry shelves, or around window sills keep flies from settling. Bay leaf spray (simmered leaves strained into a spray bottle) is a stronger version for surfaces. It’s worth trying before reaching for anything harsher.

Herbs planted near entry points – basil, mint, lavender, rosemary – do double duty: they repel flies and they look intentional rather than desperate. Pot them near kitchen windows or on the doorstep. The mint especially earns its place.

None of these natural repellents will eliminate flies that are already breeding in your drain or rotting in your trash. They’re preventative. Use them after you’ve dealt with the source.

Drain and Kitchen Sanitation

This is where most indoor fly problems actually live. Specifically the drain. Organic matter accumulates in kitchen drains, bathroom drains, and shower drains, and certain flies (drain flies, fungus gnats, some fruit fly species) will happily breed in that sludge for months while you wonder where they keep coming from.

Finding and eliminating the breeding source is the single most important step. Not trapping flies, not spraying. Finding where they’re reproducing and destroying that. For fruit flies, it’s usually something you haven’t noticed: a potato going soft at the back of a cupboard, an overripe tomato, the dregs at the bottom of a recycling bin. Check everything. The source is always somewhere you didn’t think to look.

Once found: remove it, clean the surface, don’t leave it to happen again. Store produce in sealed containers or in the fridge. Dispose of food waste frequently – don’t let it sit in a bin inside for three days in summer.

For drains specifically: boiling water poured directly down the drain once a week disrupts the organic buildup. Enzyme-based drain cleaners (not caustic drain unblockers – the enzyme kind) break down the organic matter flies breed in. The baking soda and vinegar flush (half a cup of each, let it fizz for 10 minutes, flush with hot water) is a reasonable DIY maintenance routine. The salt, baking powder, and vinegar weekly treatment is a variant of the same principle with slightly better residual effect on stubborn buildup.

Keep trash bins sealed and clean. A bin with a loose lid is a fly hotel. Wash the bin itself periodically – the residue at the bottom is as much of an attractant as whatever’s in the bag.

Exclusion and Barriers

The honest truth about exclusion is that most homes have gaps. Window screens with holes, gaps around pipe penetrations, spaces under doors. Flies are small. They don’t need much.

Sealing cracks and gaps and installing screens is the unglamorous work that makes everything else more effective. Seal the obvious gaps around windows and doors with weatherstripping. Fix torn screens rather than leaving them for another season. The investment pays forward indefinitely.

Insecticide sprays have their place, but they’re more a reactive tool than a preventative one. A spray around window frames and door edges creates a residual barrier that kills flies on contact for a period of days to weeks depending on the product. It won’t stop them breeding inside if you haven’t dealt with the source. For a genuine infestation that’s already inside, sprays used in conjunction with source removal and traps can accelerate the clear-out.

Outdoor Hygiene

The outdoor environment feeds the indoor problem. Fix what’s happening outside and you reduce the pressure indoors.

Pet waste is a significant fly breeding site. Pick it up daily, not weekly. This is non-negotiable if you’re dealing with persistent fly problems in summer.

Grill residue – the grease, the food debris in the drip tray – attracts flies fast, especially in warm weather. Clean the grill after every use. The drip tray specifically. It’s easy to forget and it’s a major source.

Standing water is a breeding site for some fly species and a general attractant. Repair leaky faucets, empty anything that collects water (plant saucers, decorative pots, kids’ toys), and run outdoor taps briefly to clear stagnant water from pipes. The "run water for one minute weekly" advice sounds fussy but it’s specifically about clearing out pipes that have gone stagnant – worth doing if you have outdoor taps you don’t use often.

Where It Shows Up

Inside the house – the general infestation scenario: houseflies battering windows, fruit flies orbiting the fruit bowl. The causes are usually some combination of an open entry point and an indoor attractant. Start with our guide to flies in the house for the full list of methods.

In the kitchen – the fly problem that’s specifically kitchen-rooted: drain flies, fruit flies around produce, the swarm that appears when you open the bin. Kitchen flies almost always have a kitchen source. The flies in the kitchen guide goes deeper on source elimination and drain maintenance.

Outdoors – summer flies around the patio, grill, or garden. The outdoor problem is usually about what’s out there (waste, standing water, compost) rather than anything you can spray your way out of. See flies outdoors for what to prioritize.

Causes

Flies don’t appear because you have a pest problem in some abstract sense. They appear because they found what they need.

Houseflies need organic waste to breed – garbage, pet waste, compost, animal matter. If you have an outdoor fly pressure problem, look at what’s within 300 ft (90 m) of your house. A neighbor’s compost heap, an unsecured trash area, a dumpster – these generate fly populations that will pressure your home regardless of how clean you keep it.

Fruit flies and drain flies are almost always an indoor breeding issue. The population you’re seeing hatched somewhere inside your home in the last week. Find it. The adults you can see are the output of a breeding site you haven’t identified yet.

Cluster flies are different – they’re overwintering flies that enter in autumn and emerge in spring, and they’re not breeding inside. They’re just sheltering. You’ll find them in attics, wall voids, and south-facing windows when temperatures warm. Source removal isn’t relevant here – exclusion is.

Prevention

You can get to a point where flies aren’t really a problem rather than a repeating battle. It takes consistent habits, not heroic interventions.

Keep entry points sealed. Replace damaged screens in spring, before fly season. Weatherstrip doors properly. These are one-time fixes that compound over time.

Store food correctly. Fruit and vegetables either in the fridge or in sealed containers once they’re past the firm stage. Bread in a bag. Nothing open on the counter for extended periods in summer.

Take out the trash frequently. Don’t let it go more than a few days in warm months. Clean the bin itself every couple of weeks – the liquid at the bottom is prime breeding material.

Clean drains monthly. A simple enzyme cleaner and the run-water routine is enough. You’re preventing accumulation rather than clearing an established colony, which is much easier.

When to Call a Pro

Most fly infestations are self-solvable. The cases where you should bring in a pest controller are specific:

  • You’ve done thorough source elimination and the population isn’t declining after two weeks
  • You’re dealing with a structural issue – flies coming from inside walls, from a crawl space, or from somewhere you can’t access to clean
  • You have cluster flies in the attic or wall voids in large numbers (treatment typically involves professional-grade residual insecticides in inaccessible spaces)
  • There’s an animal carcass somewhere in the structure that you can’t locate and remove – a dead animal in a wall cavity will generate massive fly activity for several weeks

A pest controller for flies doesn’t need to be a recurring contract. A single visit to identify and treat a specific problem is often enough.

FAQ

Why do I keep getting flies even though I keep my house clean?
The source is probably somewhere you haven’t checked yet. Fruit flies breed in minimal quantities of organic matter – a forgotten potato, residue inside an empty bottle, the drip tray under the fridge. Drain flies breed in the film inside pipes, not in anything visible. Clean the obvious stuff, then look harder at the drains and the back of cupboards.

Do fly sprays actually work?
Yes, but only at what they actually do: kill flies that contact the treated surface. They don’t eliminate breeding sites and they don’t provide lasting prevention if the underlying cause is still there. Use them as one layer, not the whole solution.

How long does it take to get rid of a fruit fly infestation?
If you remove the breeding source completely, the adult population typically drops off within 7-10 days (roughly the adult lifespan). If you’re still seeing flies after two weeks, there’s a source you haven’t found and removed yet.

Are flies dangerous?
Houseflies carry pathogens on their bodies and can contaminate food – it’s a real issue, not just aesthetic. Fruit flies and drain flies are more annoyance than health hazard. The urgency level scales with the species and where they’re landing.