The short answer
- Find the breeding spot first. House flies and blow flies develop in garbage, pet and animal feces, carrion and moist rotting plant material, and under summer conditions can go from egg to adult in as little as 7 days.[1][4]
- Bag food waste and pet droppings in sealed plastic bags, keep trash in cans with tight lids set away from the house, and wash the cans out. UC IPM says to set cans out for pickup at least once a week even when they aren't full.[1][4][3][6]
- Pick up dog droppings promptly, rake up or compost wet grass clippings, and turn the compost pile so it heats.[4][1][3]
- Hang odor-baited fly traps well away from where you sit: they smell bad and work poorly when garbage nearby competes with them. San Bernardino County says at least 25 feet from the house.[1][5]
- Fly baits and sprays help only alongside cleanup. UC IPM notes that most home situations don't need pesticides at all.[1][7][3]
Backyard fly profiles
Which flies are in your yard?
A handful of flies cause most backyard complaints, and the species tells you where to look for the source. The identification page on types of house flies has photos and details; the short version is below.[1][4][2]
- House fly: grayish-black with dark stripes on the thorax. It can't bite, but it lands on food and people and breeds in garbage, manure, lawn clippings, rotting fruit and vegetables, and soil soaked with any of these.[1][5][2][3]
- Blow flies and bottle flies: shiny metallic green, blue or coppery flies. In towns their most common breeding site is kitchen waste in trash cans; piles of pet waste and dead animals can also produce them. They make outdoor cooking difficult because they are drawn to food and garbage.[1][5][3]
- Little house fly: about two-thirds the size of a house fly, without the stripes. Males fly back and forth in still, shady spots such as porches, breezeways, entryways and garages, often around head height. They breed in animal waste, fermenting grass clippings and compost and in California are most numerous in the cooler spring and fall.[1][5]
- Stable fly: looks like a house fly but has a pointed beak and gives a painful bite, mostly on the legs and lower body. Away from farms, piles of wet grass clippings and backyard compost can breed it; UC IPM notes a single compost pile may supply a whole neighborhood.[1][3][5]
- Flies that rest in sunshine on the south and west walls of a house in late summer and fall are usually cluster flies or face flies looking for a place to spend the winter. Control for them starts outside with sealing gaps in siding, eaves, vents and utility openings.[3]
Step 1: Find where they are breeding
Adults fly in from wherever the maggots grew. Texas A&M says most house flies stay within ½ to 1 mile of their breeding site, though they can travel as far as 20 miles; San Bernardino County says the source in a city is usually within a city block, though flies sometimes travel several miles. Either way, start in your own yard.[2][5]
- Trash and recycling cans, especially any with food waste that wasn't bagged, liquid in the bottom, or residue under the liner.[1][2][4]
- Pet droppings in the yard or dog run. NPIC notes that damp droppings can breed maggots.[4][6][1]
- Piles of fresh or wet grass clippings, rotting mulch, fallen fruit and vegetable scraps.[1][3][5]
- Compost bins and piles that stay wet and aren't turned.[1][2][4]
- A dead bird or animal under a deck or in a hedge; blow flies and flesh flies breed in carrion.[3][2]
- Wandering maggots: mature larvae leave wet material to find a drier spot to pupate, which is why maggots are sometimes seen crawling out of an outdoor trash can.[1][3]
- If your own yard is clean, look farther: Texas A&M lists livestock and compost operations, faulty latrines and poorly kept dumpsters or garbage cans as sources of outdoor house fly problems. For flies coming from horses, chickens or other animals, see the barn and livestock guide.[2][6]
Step 2: Fix the trash cans
Garbage is the breeding site behind most backyard house fly and blow fly problems, and UC IPM names poor sanitation and poor exclusion as the main reasons people have house fly problems.[1][4]
- Put kitchen waste in plastic bags and tie them closed before they go in the outdoor can.[1][3][6]
- Use cans with tight-fitting lids and keep them as far from doors, windows and the patio as practical. NPIC suggests keeping outdoor dumpsters at least 50 feet from kitchen doors and windows.[1][3][4]
- Get garbage out often. UC IPM says to set cans out at least once each week even if they aren't full, because garbage that sits longer than a week is likely to produce blow flies; NPIC suggests taking trash out once or twice a week.[1][4]
- Wash cans regularly with soap and water to remove residue, and hose out liquid that collects under the bag.[1][3][2]
- Rinse cans, bottles and other containers before they go into recycling.[4]
Step 3: Pet waste, grass clippings and compost
These three are the other common backyard breeding sites, and each has a simple fix.[1][4][3]
- Pick up dog droppings as soon as you can, seal them in a plastic bag and put the bag in a lidded can. UC IPM recommends clearing organic waste, including dog feces, at least once a week.[4][1][6]
- Don't leave clippings in piles. Rake up wet clippings or work them into a properly managed compost pile; San Bernardino County advises getting rid of moist decaying vegetation such as lawn clippings each week.[1][3][5]
- Turn compost regularly so it heats up and breaks down quickly; an unturned wet pile can breed stable flies and little house flies. Minnesota Extension also suggests covering compost piles with black plastic sheeting.[1][3]
- Manure from backyard animals needs the same treatment: remove it, spread it thin to dry completely, or compost it with turning.[1][7]
- Remove dead birds and animals, rotting mulch and fallen fruit from the yard.[3][1]
Step 4: Use traps the right way
Traps catch adults but don't stop new flies from emerging, so they work best once the breeding sites are gone. Where you put them matters as much as which kind you buy.[1][2]
- Odor-baited jar or bag traps (inverted cone traps with a food attractant) do work outdoors, but only when they aren't competing with nearby garbage or animal waste.[1]
- The bait smells foul, so hang these traps away from the house, the patio and anywhere people sit. UC IPM says to keep them some distance from occupied buildings; San Bernardino County says use them at least 25 feet away from the house.[1][5]
- These traps also catch blow flies, which is useful because blow flies seldom rest on the vertical surfaces where sticky ribbons hang.[1]
- Sticky fly paper and ribbons are useful for a few flies in a confined space such as a garage or porch, but UC IPM says they aren't effective enough for an outdoor setting. Hang them out of reach of children and pets.[1][3]
- Ultraviolet light traps can work indoors, where they don't compete with sunlight. Don't use a bug zapper near food or where you cook: UC IPM warns that insects can burst on the grid and scatter body parts several feet.[1]
- Use trap counts to judge your progress. Kentucky's livestock fly guide notes that a big jump in catches from one week to the next is a signal to look again at sanitation, and a review by Gerry (2020) describes counting the fly specks left on white cards as another way to track fly activity over time.[7][8]
Fly baits: where they help
Fly baits combine an attractant with an insecticide and come as bait-station products or as liquids or slurries applied where flies land. Their attractants are designed for house flies.[2][1][7]
- Put them where flies gather, such as a trash storage area. UC IPM says baits there can reduce adult flies, but only if sanitation keeps maggots from developing in the waste; baits alone won't control flies that have access to garbage.[1]
- Baits work best when there are few other food sources around, according to Kentucky Extension.[7]
- They do little for some flies. Baits don't work against the biting stable fly, little house flies aren't drawn to them, and blow flies respond poorly, though UC IPM says baits placed on the ground around trash containers may give some control.[7][1]
- Some baits are toxic to pets and livestock. Use bait stations or spots that dogs, cats, chickens and children can't reach, and follow the label.[2][7]
- Flies can become resistant to pesticides, NPIC warns. House flies have developed resistance to every major insecticide class, and Hubbard and Gerry (2020) found inherited behavioral resistance to imidacloprid, the neonicotinoid most widely used for fly control, in house flies from a California dairy.[4][9]
Sprays: a short-term add-on
Minnesota Extension says insecticides don't give long-term fly control but can cut numbers for a while. UC IPM puts them last, after nonchemical steps, and says screens and sanitation should be enough in most homes.[3][1]
- Space sprays and aerosols with pyrethrins kill the flies they hit and leave little residue. San Bernardino County lists them for use indoors or on patios and porches.[5][1][3]
- Residual sprays go on surfaces where flies rest. Minnesota Extension suggests treating outdoor surfaces with heavy fly activity, such as around doors, windows, garbage cans and dog houses, with a product such as permethrin or bifenthrin that is labeled for that site; UC IPM suggests hiring a pest control company to treat walls and overhangs where flies rest.[3][1]
- Check the label before spraying hard surfaces. Texas A&M notes that many labels now prohibit spraying pavement, surfaces exposed to rain, or surfaces that drain onto pavement.[2]
- Fogging the shrubs around a yard is a poor trade. UC IPM says it gave only a few days of relief from canyon flies in California and harms many beneficial and harmless insects.[1]
Flies hovering on the porch or patio
The slow-circling flies that hang in the air under a porch roof are usually male little house flies, which gather in still air out of direct sun.[1][5]
- Clean up the breeding sites they use, especially fermenting grass clippings, compost and animal waste.[1][5]
- Run a strong fan where they swarm. UC IPM says moving air makes these spots less attractive and breaks up the swarms.[1]
- Don't count on fly baits or house fly traps; little house flies aren't attracted to them.[1]
- In parts of California, native canyon flies are a nuisance near canyons and hillside neighborhoods, mostly in the cooler morning and evening hours. UC IPM links one species to the red apple ground cover; removing that plant is the only management found to work so far.[1]
If the flies bite: stable flies and your dog
A house-fly look-alike that bites ankles is probably a stable fly. Both sexes feed on blood, and they also bite dogs, especially on the ear tips.[1][3]
- Remove the wet grass clippings, hay and compost they breed in; UC IPM calls this the most effective and economical step.[1][5]
- Dogs kept in outdoor kennels can be bitten severely. UC IPM says repellents containing permethrin or pyrethrins protect dogs and horses but have to be reapplied every other day; use only a product labeled for that animal.[3][1]
- Fly baits won't help, because stable flies don't feed on them.[7]
What doesn't work
Some common tricks have no support in the extension guidance.[6][1]
- Bags of water with a penny hung over a door: Mississippi State Extension says this and other homemade remedies just don't work.[6]
- Bug zappers on the patio: they don't fix a breeding source, and UC IPM warns against using them near food preparation areas.[1]
- Spraying alone: without cleanup, flies keep emerging from the source. NPIC calls getting rid of the breeding sites the most effective way to get rid of flies, and Minnesota Extension notes that insecticides don't give long-term control.[4][3][1]
Common questions
- Why are there so many flies in my backyard all of a sudden?
- Something nearby is breeding them, often a trash can, dog droppings, a pile of grass clippings, a compost pile or a dead animal. In summer, flies can go from egg to adult in about a week, so numbers climb fast.[1][4][3]
- Where should I hang an outdoor fly trap?
- Away from the patio and doors, because odor-baited traps smell bad. San Bernardino County says at least 25 feet from the house, and UC IPM notes the traps work best when they aren't competing with nearby garbage.[5][1]
- Do bags of water keep flies away?
- No. Mississippi State Extension says hanging water bags with a penny and similar home remedies don't work.[6]
- Is fly bait safe around dogs?
- Some baits are toxic to pets and livestock. Place bait only in stations or spots animals can't reach and follow the label.[2][7]
- Do I need to spray my yard for flies?
- Usually not. UC IPM says sanitation and screens should be enough in most home situations, and Minnesota Extension notes that sprays give only temporary relief.[1][3]
Photo credits
- House Fly: ivan_humljani, public domain (CC0), via iNaturalist
- Common Green Bottle Fly: (c) Katja Schulz, some rights reserved (CC BY) — via iNaturalist, CC BY 4.0
- Stable Fly: (c) Phoenix M.S, some rights reserved (CC BY) — via iNaturalist, CC BY 4.0
- Lesser House Fly: (c) Dustin Edmundson, some rights reserved (CC BY) — via iNaturalist, CC BY 4.0
- Flesh Flies: (c) Lek Khauv, some rights reserved (CC BY) — via iNaturalist, CC BY 4.0
- Cluster Fly: (c) Steve Kerr, some rights reserved (CC BY) — via iNaturalist, CC BY 4.0
- Black dump fly: Hydrotaea aenescens by Janet Graham (CC BY 2.0), via Wikimedia Commons — via Wikimedia Commons, CC BY 2.0
Sources
- University of California Statewide IPM Program, “Pest Notes: Flies.” ipm.ucanr.edu/home-and-landscape/flies/ (accessed 2026-11-10)
- Texas A&M AgriLife Extension, “Indoor Flies and Their Control.” agrilifeextension.tamu.edu/library/insects/indoor-flies-and-their-control/ (accessed 2026-11-10)
- University of Minnesota Extension, “Flies.” extension.umn.edu/garden-and-home/home-maintenance/household-insects/flies (accessed 2026-11-10)
- National Pesticide Information Center, “Flies.” www.npic.orst.edu/pest/flies.html (accessed 2026-11-10)
- San Bernardino County Department of Public Health, Environmental Health Services, “Flies.” www.sbcounty.gov/uploads/dph/EHS/Programs/Vector/flies.pdf (accessed 2026-11-10)
- Mississippi State University Extension Service, “How to Control Flies in Your Home.” extension.msstate.edu/blogs/extension-for-real-life/how-control-flies-your-home (accessed 2026-11-10)
- University of Kentucky Entomology, “Fly Control for Small-Scale Horse and Livestock Operations (ENTFACT-514).” entomology.ca.uky.edu/ef514 (accessed 2026-11-10)
- Journal of Economic Entomology (PubMed 33057651), “Review of Methods to Monitor House Fly (Musca domestica) Abundance and Activity. J Econ Entomol 113(6):2571-2580 (Gerry 2020).” pubmed.ncbi.nlm.nih.gov/33057651/ (accessed 2026-11-10)
- Journal of Medical Entomology (PubMed 32516402), “Selection, Reversion, and Characterization of House Fly Behavioral Resistance to the Insecticide Imidacloprid. J Med Entomol 57(6):1843-1851 (Hubbard & Gerry 2020).” pubmed.ncbi.nlm.nih.gov/32516402/ (accessed 2026-11-10)