Lawn & Garden

How to Get Rid of Flies Outside

Are swarms of flies keeping you from enjoying your outdoor space? Learn why they're congregating at your place, and how to get rid of them for good.
Bob Vila Avatar
Rear view of man holding fly swatter.

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

Landing on food at your barbecue, buzzing around your face while you’re doing yard work, and crashing parties on your patio, flies bring a little bit of annoyance to pleasant outdoor pastimes. While flies are around all year, and you might even see them on warmer winter days, they tend to be most active from spring through fall. Flies generally reach their irritating peak during the warm summer months. 

But flies are more than just nuisances: They carry a variety of germs, such as the bacteria that cause anthrax, typhoid, stomach ulcers, cholera, dysentery, and tuberculosis, as well as less serious illnesses. Although common houseflies don’t bite, they can deposit bacteria wherever they land—for instance, on that hamburger you’re about to bite into. 

To discourage these pervasive and potentially harmful pests, it’s important to understand why they’re hanging around in the first place.

What attracts flies outdoors?

While there are thousands of species of flies, houseflies and blowflies tend to be the ones that flit annoyingly around your outdoor spaces. Known as filth flies, these insects are attracted to decaying organic matter like garbage, excrement, and carrion. Such tempting, smelly treats provide both food and a place to lay eggs, which flies produce in impressive numbers. A female housefly, for instance, can lay about 500 eggs in its lifetime, in batches of 75 to 150. (Not bad for a creature whose lifespan is generally less than a month.) 

Larvae (maggots) emerge from the eggs in as few as 8 to 20 hours, if the weather is warm enough. After several larval stages, the maggots develop into pupae, from which fully grown flies emerge. In optimal conditions, a housefly can complete this cycle in as few as 7 to 10 days.

With such a supercharged reproductive cycle, a few flies can quickly develop into an outdoor infestation. You might have indoor fly problem on your hands soon, too, if you don’t take steps to control them.

Signs of a Fly Infestation

Fly maggots crawling on the outside of a black trash bag.

The most obvious sign of an infestation is the sudden appearance of a lot of flies, but there are some indications that an infestation may be brewing. You might notice maggots, which look like small white worms, in your trash cans or compost bin. Or perhaps you’re finding little black dots—fly poop or flyspeck—on patio surfaces. But the surest sign that flies are on the way is the presence of the kinds of stinky, putrefying matter they seek out. 

As entomologist Jody Gangloff-Kaufmann, senior extension associate at the New York State IPM Program at Cornell University, puts it, “Flies tell a story.” When you have a lot of filth flies hanging around, they’re telling you that “there’s something rotting nearby.”


In your quest to rid your yard of flies, you probably won’t need to use all of the supplies below—but you’ll want to have this gear at the ready as you try different deterrents.

Disposable gloves
Mason jar
Oscillating fan
Extension cord
Mesh food covers

Before You Begin

Methods for getting rid of outdoor flies are pretty straightforward, but if you’ll be handling flies, dead or alive, it’s a good idea to wear disposable gloves to prevent bacteria from getting on your hands. The same goes for handling fly traps.

6 Ways to Get Rid of Flies Outside

Strategies for outdoor fly control involve either killing, trapping, or repelling the critters. The approach you choose will depend on the severity of the infestation and your tolerance for cleaning, maintenance, and bad odors.

1. Eliminate the root cause.

Multiple flies on rotting vegetables in a compost bin.

If you’re trying to figure out how to get rid of flies outdoors, start by finding what’s causing an infestation. You shouldn’t have to go too far. “They are really good flyers, but usually the source is within reach,” explains Molly Keck, an entomologist with Texas A&M Agrilife Extension Service in Bexar County. First, check your immediate property. If you see flies hovering around the trash cans, give the cans a good cleaning and let them dry out thoroughly. If flies are infesting the compost pile, turn the pile more frequently and let it dry out a bit. 

After digging around, you may find that your flies are coming from a neighbor’s yard or a nearby restaurant Dumpster. Regardless of where they’re coming from, if you don’t find and correct the source, you won’t eliminate the problem.

2. Make a fly trap. 

DIY fly traps can be extremely effective at catching and killing flies, and there are plenty of versions available online to use as fly repellent outdoors. Here’s a basic setup:

  • Dissolve ¼ cup of sugar in 1 cup of water and pour it into a mason jar. (For a smellier, possibly more effective bait option, use a raw shrimp or a piece of raw chicken in place of the sugar.)
  • Roll a piece of cardstock into a cone long enough to reach from the top of the jar to just above the level of the liquid; the wide end of the cone should completely fill the jar’s mouth. 
  • Snip off the tip and tape the cone inside the jar, making sure that the wide end of the cone seals the jar’s mouth and the tip sits right above the water. 
  • The cone will funnel curious houseflies right into the jar, where they will drown.
  • Keep an eye on the trap and dispose of (or empty it) when it gets too full or too smelly. Put the entire trap, or just the contents, into a bag and seal it tightly before throwing it out. Wear gloves when touching the dead flies.

3. Plug in some fans. 

Group of friends enjoying an outdoor picnic with fan on table.

What keeps flies away outside? Well, a stiff breeze might help. These party crashers are strong flyers, but they don’t like fighting the wind, so an oscillating fan or two plugged into extension cords near your backyard grill, picnic table, or other gathering spot might deter them. Try a few different speeds to see what works best for you.

4. Swat them. 

Swatting flies is immediate, effective, and strangely satisfying. If you’re squeamish about doing the deed with a traditional flyswatter, try an electric flyswatter. These devices (most resemble small tennis rackets) electrocute flying bugs with a loud zap. Read the instructions carefully.

5. Keep them away from your food. 

Red metal mesh domed covers over plates of food outdoors.

When they land on food, filth flies not only excrete and regurgitate, but deposit bacteria and other unsavory stuff that they’ve picked up on their travels. To protect your food from contamination, invest in mesh covers and strategically place fly fans near your barbecue fare. These precautions won’t eliminate a fly problem, but they will give you peace of mind while you’re getting it under control.

6. Welcome fly killers to your yard. 

Make your property more hospitable to allies in your fight against flies. Attract birds with plants that offer the nectar, berries, seeds, and nuts they crave; provide them with fresh, clean water for drinking and bathing; and eliminate harmful pesticides from your yard care routine. Look kindly on beneficial fly killers like spiders. While birds, spiders, and other noted fly eaters like yellow jackets and bald-faced hornets won’t solve your fly problem, they’ll do their bit to help out.

7. Purchase a fly trap.

Outdoor fly trap hanging with people in lawn chairs in the background.

If you don’t feel like making a DIY-ing fly trap, there are many well-rated commercial products worth trying. These are for outdoor use only and must be hung at a distance from the house—typically 20 to 25 feet, depending on the product. Always follow instructions for use and disposal, and monitor the traps to make sure they don’t get too full. Be forewarned that they smell truly awful, and remember that traps and other fly-killing methods will only help reduce the fly population. “If you haven’t found the source, you’re still going to have flies,” Keck warns.

What Not to Try

The internet is awash with “can’t miss” fly-control strategies that either don’t work well or do more harm than good. Here are a few to avoid, and why.

  • Bug zappers: They’re undeniably effective at killing insects, but they kill good bugs and bad alike. If you have a problem with flies, stick with fly-specific solutions.
  • Flypaper and fly strips: These, too, kill bugs indiscriminately, although if you have a fly problem in a relatively contained space, such as a garage, shed, or barn, they can be effective.

Fly-Removal Methods That May Not Work but Won’t Do Any Harm

Other common fly-control solutions might be touted to work, although experts warn that they are not consistently effective. 

  • Hanging baggies filled with water: Water-filled baggies are popularly believed to deter flies, but this is probably an old wives’ tale. Mythbusters tackled this question back in 2010 and declared this myth “busted,” yet plenty of people swear by it. 
  • Hanging baggies filled with water and a few pennies: See above.
  • Hanging bars of Irish Spring soap: This popular internet strategy isn’t backed by scientific evidence, but it might leave your yard smelling “fresh and clean as a whistle.”
  • Using essential oils as deterrents: While some essential oils are used in very high concentrations for pest control, a homemade concoction of essential oils in a spray bottle is unlikely to have much of an effect. Plus, these volatile oils tend to evaporate quickly—and until they do, the strong scents can be unpleasant backdrops to a backyard gathering.
  • Lighting citronella candles: According to Gangloff-Kaufmann, while citronella is considered a mosquito repellent, “it’s not going to do anything for common flies around the house.”

When to Call a Professional

You probably don’t need to get a pro involved with an outdoor fly problem. As Gangloff-Kaufmann says, “There’s no reason to use pesticides on insects that exist out in the environment unless they’re in a concentrated place, and that means there’s a sanitation issue.” Keck concurs: “It’s all about sanitation.” 

Perhaps if you’re having trouble pinpointing the source of an infestation, or if you’ve found the source and it’s something that you can’t clean effectively, a professional might bring something to the table. But beyond that, source reduction is the key to getting rid of outdoor flies.

How to Prevent Flies From Returning

Man sweeping a wood deck with a broom.

Once you’ve given pests the heave-ho, discourage the reappearance of flies and maggots with these smart strategies:

  • Keep your place clean. Flies love open garbage pails, uncovered compost piles, dog droppings, food scraps, tasty spills, and rotting vegetation. Tidy up after outdoor parties; keep a tight lid on trash cans; maintain and cover the compost pile, and situate it well away from the house; don’t let dead plants and clippings pile up; and rinse out recycling before tossing it in the bin. If the family pooch does his business in the yard, clean up after him immediately.
  • Watch out for water. Most fly species need a moist environment to lay their eggs and complete their life cycle, so “reducing water sources can definitely help,” Keck says. To eliminate excess water, look over your yard regularly, fix dripping sprinklers, and correct conditions that lead to perennially muddy patches.
  • Clean fruit bird feeders. It’s fun to watch backyard birds feeding on fruit, but flies are bound to be unwelcome guests at the party. Toss the rinds as soon as your feathered friends finish their feast.
  • Mow regularly. Flies can lay eggs in long grass, which offers them moisture and protection. Mow your lawn weekly during the peak growing season to stave off an infestation.