Interior Pests

How to Get Rid of Flies in the House

More than merely pesky, houseflies can transmit disease. Use these simple tactics to banish the bugs and keep them out for good.
how to get rid of flies in house


We may earn revenue from the products available on this page and participate in affiliate programs. Learn More ›

As warm weather sweeps in, so does an annual nuisance: houseflies. The small black pests that get in your face, buzz in your ear, and land on your food may seem like a harmless though incessant irritation, but in fact houseflies (officially known as Musca domestica) are not as innocent as they seem.

Why Houseflies Are Harmful

Houseflies may not deliver a painful bite or sting the way bees, wasps, gnats, and horseflies (their bigger cousins) do, so they can seem benign. But houseflies constantly flit back and forth between trash, manure, and decaying matter, picking up bacteria that can contaminate your food. Transmission typically occurs when a fly regurgitates directly on food or on surfaces that humans touch. This can cause a number of illnesses, including:

  • Food poisoning
  • Dysentery
  • Cholera
  • E. coli
  • Typhoid fever
  • Tuberculosis
  • Eye infections

As if this litany of ills weren’t enough, we can expect to see increasing numbers of these little critters as the planet warms up. A 2019 Canadian study that modeled fly population size and activity under various climate scenarios predicted a roughly 30 percent increase in the transmission of campylobacter, a bacteria that causes gastrointestinal illness, by 2050.

Infestations start small. Although you may at first spy just one fly, females can lay five to six batches of 100 eggs that hatch in 12 to 24 hours, leaving you wondering, “Why are there so many flies in my house?” To get rid of houseflies, you’ll need a multipronged approach. Use these strategies to prevent houseflies from becoming a real problem at your place.

Magnetic Screen Door to keep out flies

7 Things You Can Do to Get Flies Out of Your House

1. Seal flies’ pathways into the house.

It can be challenging to keep nuisance flies out when you’ve got a busy household of family members, pets, and visitors coming and going, but a good defense is essential:

  • Repair damaged screens on windows and doors.
  • Caulk around windows to seal gaps and small crevices where flies could enter.
  • Consider adding a quick-closing magnetic screen door to high-traffic portals, such as those leading out to a deck or patio.
  • Don’t leave attached garages or cellar doors open for extended periods.

2. Clear out food debris and garbage.

To make your home less hospitable to flies, remove or minimize the stuff that attracts them. First and foremost, don’t leave any food debris out on counters or tables, especially uncovered items. Fruit—especially apples—and vinegar are particularly alluring to houseflies. Also:

  • Keep countertops clean of crumbs, wash dishes soon after meals rather than leaving them in the sink, and ensure that the door to the dishwasher is firmly closed.
  • Be mindful of compost, garbage, and pet food. These also attract flies and can quickly become breeding grounds.
  • Take all compost materials outside immediately.
  • Keep garbage cans covered, and carry the trash out regularly.
  • Clean or completely cover pet bowls between meals, particularly if you give your furry friends wet food.

Related: How to Get Rid of Drain Flies

3. Lure them with light.

Insects are attracted to light, so if you’re dealing with an infestation, here’s how to get rid of flies inside your house: On a bright, sunny day, close the door to the room where flies are present and shut the blinds and drapes, leaving just one gap that lets in light. Open that window wide to the outside. The flies should then head outside, where it’s bright.

You can also use light to lure flies in—into a trap, that is. The Safer Home Indoor Fly Trap plugs into an outlet and uses UV light to attract bugs to its sticky glue card, where they’re discreetly held until you throw out the bug-filled card.

Determined businesswoman with a flyswatter.

4. Swat them.

Despite prevention tactics, flies may still find their way in. Combat flies with a good old-fashioned flyswatter or rolled-up newspaper, and the right technique. Good eyesight and sharp reflexes are a plus in the fight against flies. A housefly has almost 360-degree vision, so it’s best to approach from behind and hover just above before making a fast, decisive flick with your weapon. Flies are one of the few insects that are actively affected by colors, so use a flyswatter in a neutral tone for superior stealth.

Sticky Fly trap hanging in a house

5. Suck (or stick) them up.

Another way to outsmart flies is to vacuum them straight out of the air. Hover a few inches behind with the vacuum on to suck them in. Use this method only with vacuum cleaners that have a bag, and dispose of it immediately after foiling the infestation so flies won’t find their way back out and back into your home.

For a passive yet ever-ready fly-catching technique, hang good-quality flypaper. You can purchase flypaper online or at a local hardware store, or make your own by coating strips of kraft paper with a sticky mixture of water, sugar, and honey or syrup. Bugs are bound to bump into the paper, whether store-bought or DIY, and get stuck as they buzz about.

6. Build and bait a natural fly trap.

Employ a simple, all-natural homemade fly trap to lure and imprison unwanted insects. All it takes is a plastic container, plastic wrap, and fly bait (like sugary water, fruit, vinegar, or apple cider vinegar). Set up the fly trap in a corner to attract and confine flies, and then dispose of them when you’ve won the battle. If the DIY route isn’t your style, shop for a fly trap to catch and kill flies.

Related: 15 DIY Solutions for a Pest-Free Home

Different aromatic potted herbs on windowsill indoors

7. Cultivate houseplants that repel flies. 

Both potted plants and essential oils can be part of your anti-fly arsenal. Start an indoor herb garden that includes mint, lavender, and basil—all worthy fly fighters. Set the plants on a kitchen windowsill, and flies will be less likely to enter. Alternatively, add a few drops of lavender or eucalyptus oil in a spray bottle full of water, and then mist door and window frames frequently to keep flies at bay.

RELATED: How to Get Rid of Flies Outside and our parent company, Recurrent Ventures, put conservation and sustainability at the forefront of much of what we do. Though the solutions offered in this content are all effective, not all of them are organic or sustainable. The staff of encourages readers to make informed choices about maintaining their home and property. We recommend starting with the least extreme solution, escalating only if necessary, and prioritizing solutions that will not have detrimental effects on the health and longevity of this planet and its inhabitants.

Insecticides That Kill Flies

If the methods above fail to solve a fly infestation, you may wish to resort to insecticides. There are, however, considerations to keep in mind. Products containing permethrin are considered to be among the most effective and widely available for fly control, but permethrin is highly toxic to cats. As well, many sprays and foggers are designed only for outdoor use, so if your problem is inside the home, you’ll need to shop around for a safe and effective nontoxic product. The following are few popular options, but remember that they are safe only if used as directed, many leave an oily residue, and most kill on contact, which means that you need to be quick to spray houseflies when you see them:

While insecticides can be helpful in getting rid of flies in the house, for peace of mind and efficiency, it’s probably best to focus on strategies for keeping flies out in the first place and eliminating the odors, food debris, and garbage that attract flies.

alternative therapy with herbs and essential oils in white background


Q: What are flies a sign of?

If you notice flies swarming in a small area, it may be an indication of rotting food or garbage, a pet accident, or a dead animal. But often flies around the house aren’t a “sign” of anything in particular—the bugs just flew in and are looking for a likely spot to feed and breed.

Q: What smell will keep flies away?

Lavender, eucalyptus, peppermint, basil, cinnamon, and lemongrass are all natural essences that deter flies. Flies also dislike the strong smell of camphor, an organic compound.