How to Get Rid of Flies Indoors

group of flies

The Spruce / K. Dave 

Few things are more annoying than houseflies disrupting an indoor meal or social gathering with their insistent swarming around the dinner table or landing on beverage glasses. You can control indoor flies to some degree with an ongoing routine of whacking them with a fly swatter, but truly controlling indoor flies requires that you not only kill them, but also block their entry points to your home and eliminate the food sources and breeding areas that draw the flies in the first place.

Identify the Type of Fly

In common terms, a fly is any insect in the Diptera order that has only a single pair of operating wings. This can include quite a large number of insect species, but the flies that plague our homes in the summertime are usually ordinary houseflies (Musca domestic). This insect can be up to 3/8 inch long with bulging reddish eyes. This creature will spend most of its time flying, and it's quick enough to pose a challenge when you wield a fly-swatter.

Less commonly, we may find cluster flies (Pollenia spp) or horse flies (Tabanus spp.) in our homes, but these are larger flies with a louder buzz, and they are usually easier to swat since they spend more time walking on the walls, furniture, or glass. Tiny fruit flies (Drosophila melanogaster) are another common pest found in the home.

In addition to its ability to annoy, the common housefly is a disease-carrying insect. Its reproductive cycle involves laying eggs in any decaying organic material, and thus it can carry any number of pathogens from place to place around the home. For example, the bacteria that a fly picks up from your cat's litter box a few minutes ago can easily be transmitted to the lunchtime potato salad if the fly happens to alight there. In the larger natural scheme, flies serve an essential function in breaking down carrion and organic material, but we should never forget that this behavior can also spread a variety of diseases.

Other types of flies have different behaviors that aren't nearly as unsanitary, so it is the common housefly that poses a notable health risk along with its ability to irritate us.

Determine the Attractions

Effective control involves a variety of efforts to kill existing flies, combined with eliminating the sources of food that flies crave. Flies come indoors not because they enjoy human companionship, but because the home offers them almost limitless sources of food and moisture.

The life cycle of the common housefly is as simple as it is rapid. Adult female flies lay 75 or more eggs on or in any decaying organic material, which can include everything from a small spill of food in the corner of a kitchen, to pet feces in a litter box, to a dead beetle carcass in the utility room. In as little as two days, these eggs hatch into little white larvae, which we commonly know as maggots. The maggots feed on the organic material in which they hatch, and within just a few more days, they complete their pupal cycle and produce another generation of adult flies.

The key to disrupting the housefly cycle, then, is to eliminate the organic material in which houseflies lay eggs. A messy house is quite often a house plagued with houseflies, while a spotlessly clean house may suffer only the occasional fly that sneaks in through an open doorway or window.

3 Ways to Get Rid of Flies Indoors

Keep Things Clean

There is no other way to put it: If you want to eliminate houseflies, you must keep your home neat and tidy, and above all, free of spilled foods and other organic material where flies lay eggs. House flies are sometimes called filth flies for good reason—decay is the favorite habitat for these flies. In addition to organic material upon which to feed and breed, flies also require moisture, so make efforts to eliminate dampness in your home.

  • Keep trash closed in lidded containers and take it out often.
  • Clean spills quickly and cover any non-refrigerated foods.
  • Don't let dirty dishes sit in the sink for too long.
  • Keep pet feeding and litter areas clean.
  • Fix drips and eliminate any areas of excess moisture.
cleaning dirty dishes
The Spruce / K. Dave  

Kill Flies With Mechanical Means

Getting rid of existing flies in your home is best accomplished with a combination of killing them with a fly swatter and trapping them.

You might think there's no particular skill to using a fly swatter, but you'll be most successful if you wait for a fly to alight on a wall or window, approach slowly with the fly swatter, then strike your blow with a sudden flick of your wrist. Swinging from the shoulder or trying to smack a fly while it's flying is rarely successful. A fly swatter should never be used near food areas, and it should be disinfected after each use.

fly paper
The Spruce / K. Dave 

A variety of commercial fly traps are available. Many of these use a sealed container with a center baffle, through which the flies enter as they try to reach a pheromone bait. You can also make your own bait simply by mixing sugar or molasses with water, An ordinary plastic soda bottle filled with sweetened water makes a fairly good home-made fly trap.

You can also buy sticky papers or strips of various kinds to trap flies. Hung in the air or applied to windows, these products will trap any flies that alight on them.

Finally, there are ultraviolet indoor fly traps that lure flies with light, then trap them with disposable sticky pads. This type of indoor trap should be placed no more than 5 feet above the floor, in a location where it can't be seen through windows (otherwise, it will attract outdoor flies). And position the ultraviolet trap away from competing sources of light and away from food preparation areas.

Use Pesticides Responsibly

Although many people think of chemical insecticides first for any pest control, chemical control should be avoided if possible. Through overuse, the common housefly has gradually developed resistance to many chemicals, which means that increasingly heavy applications are necessary to kill them. While pesticides may make some sense outdoors, it's best to avoid them indoor spaces whenever possible.

Traditional pesticides are comprised of various toxic chemicals, and despite manufacturers' assurances that they pose no human health risk, the Centers for Disease Control and Prevention note that all pesticides will pose hazards if they are overused or used contrary to label directions. And under no circumstance should you ever use an outdoor pesticide to control flies or other insects in an indoor environment.

In the arena of contact spray pesticides, the safest choice is a pyrethrin-based insecticide, which is derived from an extract from chrysanthemum flowers. These pesticides kill insects on contact. They are low in toxicity to humans, but toxic to dogs in large amounts.

Warning

Pest strips were once a common remedy for house flies, but it's now known that the chemicals outgassed by these products can be harmful to pets and humans as well as insects. The worst types of pest strips have now been outlawed, but some products containing dichlorvos (2,2-dichlorovinyl dimethyl phosphate) are still legally available. These strips will release an insecticide vapor for up to four months. If you use them, limit their use to closets, attics, garages, and other spaces that aren't regularly inhabited.

Another means of using pesticides is for indoor residual spraying (IRS), which involves spraying surfaces with an insecticide that remains in place and kills insects that contact the surfaces for several weeks or even months afterward. This is a strategy most often employed in regions where malaria-carrying mosquitoes are common, and it is not a good method for controlling nuisance houseflies.

There are, however, some residual pesticides that are made from synthetic forms of pyrethrins. Lambda-cyhalothrin is one such synthetic pyrethroid. It is not a good idea to spray entire walls with this pesticide, but it can be useful for spraying around window and door frames and other openings to kill houseflies as they enter your home.

What Causes Flies?

Houseflies are extremely prevalent insects that are found in virtually every part of the world where organic material exists and where conditions are right for decay. Ecologically, flies serve a valuable function by laying eggs that develop into maggots that consume and break down dead organic material such as carrion.

Humans are an inherently messy species, and thus house flies are present almost everywhere humans live.

How to Prevent Flies Indoors

Preventing indoor houseflies is largely a matter of blocking their entry into the home from outdoors at the same time you make efforts to clean up organic material that offers them food and breeding opportunities.

Consider these means of exclusion to eliminate the ways that flies can get into the home:

  • Keep window and door screens in good repair.
  • Keep doors, windows and vents closed when not in use. Use automatic door closing devices where possible. 
  • Caulk or cover other possible fly entry areas, such as around vents, cracks, and holes in the house siding, and windows or doors. Screen vent openings.
  • Plug weep holes with pieces of nylon, plastic scouring pads, or window screening.

House Flies vs. Fruit Flies

Fruit flies (Drosophila melanogaster) are extremely small (1/10 inch) flying insects that selectively lay their eggs in decaying fruit and certain other food, such as mushrooms. While it can be disconcerting when a small swarm of fruit flies suddenly appears around a bowl of fruit or bunch of bananas, it should bother you less than a housefly infestation. Fruit flies essentially harmless and they do not spread disease as do ordinary houseflies.

FAQ
  • How long do houseflies live?

    Houseflies typically live no more than about 30 days, but because they reproduce so fast, an indoor infestation may be nearly perpetual provided conditions are right.

  • Do houseflies bite?

    Unlike mosquitoes or horseflies, both of which are blood feeders, the ordinary housefly does not have the mouthparts necessary to inflict bites. However, there are other flies of similar sizes, such as the stable fly that can inflict painful bites.

  • Do houseflies carry disease?

    Houseflies are one of the more serious carriers of disease, largely because of their fondness for decaying organic material such as feces. The National Environmental Health Association (NEHA) identifies several diseases can be spread by the common housefly, including cholera, shigellosis, E. coli, and typhoid fever.

Article Sources
The Spruce uses only high-quality sources, including peer-reviewed studies, to support the facts within our articles. Read our editorial process to learn more about how we fact-check and keep our content accurate, reliable, and trustworthy.
  1. Khamesipour, Faham et al. A Systematic Review of Human Pathogens Carried By the Housefly (Musca Domestica L.). BMC Public Health vol. 18, no. 1. 2018, Springer Science and Business Media LLC, doi:10.1186/s12889-018-5934-3

  2. Insect Decomposers. North Carolina State Department of Agriculture and Life Sciences.

  3. The House Fly and Other Filth Flies. Illinois Department of Public Health.

  4. Acute Illnesses Associated With Insecticides Used to Control Bed Bugs. Morbidity and Mortality Weekly Report, vol 60, no. 37, 2011, pp. 1269-1274. Centers for Disease Control and Prevention.

  5. Pyrethrins General Fact Sheet. National Pesticide Information Center.

  6. Dichlorvos. Agency for Toxic Substances and Disease Registry.

  7. Indoor Residual Spraying. Centers for Disease Control and Prevention.

  8. LX417 Lambda-Cyhalothrin. United States Environmental Protection Agency.

  9. Vector Map, Common Housefly. National Environmental Health Association, 2021.