The Many, Many Ways to Get Rid of Pesky Flies

All the ways you can trap 'em, repel 'em, and just keep them away from your home.

April 11, 2022
Photo by Rocky Luten

One thing I wasn’t prepared for when I moved from a nice, modern apartment into an old farmhouse were the bugs. There are just So. Many. Bugs. In our first year of homeownership alone, we were unlucky enough to deal with drain flies, stink bugs, the occasional house centipede, and big black flies that invaded our windows during the summer.

The latter is a common pest during the warmer months of the year, as they often sneak into your home looking for a place to lay eggs. That whole “house flies only live for 24 hours” concept is a total myth, by the way—in fact, these pesky bugs can live up to a month, according to Orkin, giving them plenty of time to pester your pets and slowly drive you to the brink of despair. (Don’t even get me started on fruit flies, which can live even longer and produce hundreds of offspring!) If you need to get rid of flies quickly, here are all the ways you can trap them, repel them, and ultimately just keep them away from your home.

Get Rid of What Attracts Them

To successfully get rid of flies, you have to think like a fly. Maybe that’s a little dramatic, but it does help to understand why they’re in your home to begin with.

You see, house flies are looking for places to lay their eggs, and they’re attracted to decaying organic material and waste, such as garbage, dirty drains, old produce, sugary spills, and even pet food. They’re also attracted to heat and light, which is why you can often find them hanging out in your windows.

Join The Conversation

Top Comment:
“"She was such a bad cook that the house flies got together and fixed her door screen!"”
— Selma M.

To make your home less attractive to flies, Ehrlich Pest Control recommends cleaning up food waste immediately—aka, no leaving half-eaten sandwiches on the counter all day—as well as investing in a covered trash can and cleaning up pet food and waste regularly. By removing these breeding areas, you can prevent flies from reproducing in your home.

While somewhat gross, it’s also worth mentioning that flies will happily lay their eggs in the bodies of dead rodents—something I learned the hard way last summer. We had a mouse that dragged a trap away in our attic, only to die in a secluded corner, and we didn’t realize what happened until it was too late. We had big, ugly flies zooming around the house for a week, and now I’m extra diligent about keeping track of all our traps. In fact, now I put them in shoeboxes with a little hole in the side so mice can’t drag the traps away.

Make DIY Fly Traps

But what about the pesky fellas that are already inside? There are a few ways to make DIY fly traps to capture and dispose of house flies, the easiest of which involves a soda bottle.

You’ll want to clean out a 1- or 2-liter plastic soda bottle, then cut off the top one-third of the bottle—basically from the label up. Fill the bottom of the bottle with a few inches of sweet liquid, such as soda or sugar water, then flip the top upside down and place it in the base, creating a funnel. Flies will be attracted to the sugar, and once they crawl down into the bottle, they won’t be able to find their way out again.

Another option is to fill a shallow dish with apple cider vinegar, a tablespoon of sugar, and a generous squirt of dish soap. Place the dish near where your flies hang out, and they’ll get stuck in the sweet mixture. This is also a tried-and-true method for capturing fruit flies.

Additionally, you can use clear fly traps to capture the bugs who hang out in your windows, and when in doubt, a fly swatter will do the trick—you just have to be quick! (Rhyme not intended.)

Other Ways to Kill Flies

I’m guilty of chasing flies around the house with my handheld vacuum, trying to suck them out of the air, but it’s definitely one of the least-effective methods of killing the pesky insects. For an inexpensive yet effective solution, you may want to invest in a pack of fly swatters, which are ideal for smacking down flies mid-flight.

Or, if you want to feel like a fly-fighting ninja, check out the Bug-A-Salt, which was recommended by one of our readers. This unique device actually shoots table salt at bugs—yes, really —effectively using the little pellets as high-speed projectiles to kill flying insects. It sounds crazy, but just take a look at all its rave reviews.

Other options to exterminate flies in your home include window sticky traps, a zapper racket, or even a pet-safe aerosol spray.

Use Plants to Keep Flies Away

Once you’ve gotten rid of the flies in your home, you may want to take steps to keep them from coming back, and luckily, you generally don’t need to use pesticides. There are a number of plants that naturally repel flies, including:

- Basil
- Bay leaf
- Lavender
- Nasturtiums
- Mint
- Marigolds

By planting the flowers near your doors or as herbs in window boxes, you can keep flies away from the places where they commonly get into your house. Plus, you’ll also have lovely blooms and fresh herbs to cook with. Win-win!

Keep Flies Out of Your Home

If you want to do everything possible to keep flies and other bugs out of your home during the summer, there are a few more steps you can take.

  • Start by inspecting your screens and patching any holes. If the screen is in bad shape, you may want to replace the whole thing. You can also add weather stripping to your doors and windows to seal off any cracks through which bugs can gain entry.

  • You’ll also want to clean up dead leaves and other yard waste, including pet waste, and if you have an outdoor compost pile, place it at least 20 feet away from your home.

When you take these steps, you’ll finally be able to enjoy a fly-free home all summer.

How are you keeping your home fly-free this summer? Tell us in the comments below.

This post contains products independently chosen (and loved) by our editors and writers. Food52 earns a commission on qualifying purchases of the products we link to.

Grab your copy

It's here: Our game-changing guide to everyone's favorite room in the house. Your Do-Anything Kitchen gathers the smartest ideas and savviest tricks—from our community, test kitchen, and cooks we love—to help transform your space into its best self.

Grab your copy

See what other Food52 readers are saying.

  • Lmar
  • Cookie
  • T
  • Rachel
  • Ruth McAllister
    Ruth McAllister
Freelance writer, product tester & baking enthusiast.


Lmar May 6, 2022
My elderly mother visited me in farmhouse in Italy one fall and she found that just sitting at the table she could catch flies under a glass, and remove them to the outdoors. They were released into the wild and chances are, she caught the same ones many times over. When I showed the farmer's wife this technic, she followed the fly outdoors and as it sat, dazed, wondering what was going on, triumphantly stomped it with her foot.
Cookie April 17, 2022
Cork will keep away fruit flies. I notice when I was in Italy that a lot of homes had wine corks in the bottoms of their fruit / vegetable bowls, and I noticed some bowls lined with cork. Ever since I put a layer of corks in my bowls, no fruit flies! I live in a warm area where my doors and windows must be open, and it had always been problem before.
T July 6, 2020
We were in Valencia, Spain a few years back at a tiny counter only cafe for their specialty, grilled fresh sardines. Spaced along the counter every few feet were lemon wedges studded with a few cloves. We asked what they were for, assuming it was some interesting condiment for a particular dish and the chef told us that they were there to keep away the flies.
Rachel July 4, 2020
We have found our Bug-a-salt (uses table salt as the weapon, so it's safe in the kitchen!) to be quite effective on the battle against flies (and other flying bugs)! It sounded like just another gimmicky product, but me husband has now gotten some for his father and brothers.
Ruth M. July 4, 2020
A speedy way to get rid of flies is to vacuum them up or use the electric shock fly swatters from the Dollar store.
Smaug July 4, 2020
I on occasion vacuum up a fly, but they're damn difficult to catch up with- maybe if you had a bunch of them swarming on a spot you could catch some. I've tried electric swatters- more often than not they just momentarily stun the fly- they'll get up and fly away in a minute or two; flies are tough. Good for mosquitos, though.
Selma M. July 3, 2020
"She was such a bad cook that the house flies got together and fixed her door screen!"
Smaug June 30, 2020
If you want to make (or buy) a bottle type trap, something really foul, such as a bottle full of rotten flies, is by far the most effective attractant. Don't know what that stuff is in the commercial versions, but it's nothing you want around the kitchen. I don't know where the notion that basil repels flies come from- they love the stuff. Water your basil with fish emulsion and you'll draw every fly in the county. Fly swatters are really the best (I recommend "Sergeant Swat" brand)- the trick (outdoors) is to find them early in the morning at the spots that the sun hits first; flies are to a great extent solar powered, and seek out hot spots to bask and get themselves started in the morning; they're relatively sluggish then.
Arati M. July 1, 2020
All great tips, Smaug! You’re an encyclopedia on the subject! :)
Smaug July 2, 2020
I would consider myself a pretty nice guy, but I do seem to spend rather a lot of time tormenting flies and gophers.
Kestrel June 30, 2020
Wait....I was hoping you sold those pretty screens shown in the photo!
Casey S. June 30, 2020
You can find the Food Net Covers here:

They're great, I hope you enjoy!
Kestrel June 30, 2020
Thank you! In my cart!
Arati M. July 1, 2020
Thanks Casey :)