Gardening & Lifestyle

What Flies Hate

Use the right smells, reduce breeding spots, and set up simple barriers so flies stay out of your beds, compost, and outdoor living areas.

By Jose Brito

Flies are part of the outdoor deal, but when they start swarming your patio, hovering over seedlings, or hanging around the compost like they own the place, it is time to get strategic. The good news is you do not need to fog your yard with chemicals to make a real difference.

This guide focuses on what helps deter flies in a garden setting. You will get practical options that work in real backyards: smell-based deterrents (close range), moisture control, clean-up routines, simple exclusion, and traps that actually pull their weight. A quick note for realism: fly pressure varies by species, weather, and what is nearby, so think in layers, not magic fixes.

A home garden patio table with a small herb pot and a fly screen covering a bowl of fruit on a sunny day

First, know what you are dealing with

Different flies show up for different reasons. If you match the fix to the fly, you will get better results.

  • House flies like trash, pet waste, and anything sugary or smelly.
  • Blow flies are drawn to strong odors, especially meat scraps and pet waste.
  • Fruit flies are all about overripe fruit, fermenting juice, and kitchen scraps.
  • Fungus gnats are often mistaken for tiny flies. They breed in consistently wet potting mix and soil rich in decaying organic matter.

If you are seeing tiny black “flies” hovering over houseplants or seed trays, skip the strong scents and jump to the moisture section. That is usually fungus gnats.

When it might not be flies: If the bugs are coming from an indoor sink or shower drain, you may be dealing with drain flies. If they are biting outdoors, that is a different problem (often mosquitoes) and the approach changes.

What helps deter flies most

1) Drier, managed breeding areas

Most fly problems are not about adult flies. They are about larvae. Flies do not do well when you remove the places where they can lay eggs and when you interrupt the wet, decaying conditions larvae need.

  • Keep lids on compost bins and trash cans tight and rinse out sticky containers before tossing them.
  • Do not leave pulled weeds or thinning piles to rot in a wet heap next to the beds. Either compost them properly or dry them out first.
  • Turn compost regularly and avoid leaving fresh kitchen scraps exposed on top.
  • Fix soggy spots under outdoor faucets, leaky irrigation, or low areas where water collects.

Note: Standing water is a bigger mosquito issue. For most common garden flies, the bigger driver is wet organic matter plus odor (compost, trash, droppings, rotting fruit).

2) Certain plant oils and scents (close range)

Flies navigate heavily by smell, and there are a few scents they often avoid. In the garden, these work best as close-range help around seating areas, doors, and bins. Outdoors, scent deterrents fade quickly and work best paired with clean-up and airflow.

  • Eucalyptus: commonly used as a fly deterrent, results vary by species and placement.
  • Peppermint: can help near entry points, but use it wisely.
  • Lavender: mild for people, and many insects seem to dislike it.
  • Clove: a sharp scent that can reduce landings in small areas.
  • Lemongrass or citronella: popular for patios and outdoor seating.

Important: Essential oils are concentrated. Avoid spraying oils directly on edible leaves or blooms. Use them on non-food surfaces like bin lids, outdoor tables, or near doors, and always dilute properly. Some oils can be harmful to pets (especially cats) and can bother beneficial insects if used heavily where they forage.

3) Air movement

Many common flies struggle with steady airflow. This is why a simple fan can be one of the best tools for a patio or covered porch.

  • Use a box fan or oscillating fan near eating areas.
  • Point airflow across the table surface where flies want to land.

4) Clean surfaces and fewer food cues

Flies love thin films of sugar, juice, and grease. They can find it even when you think something looks “clean enough.”

  • Wipe outdoor tables after meals with soapy water.
  • Rinse drink cans and bottles before recycling.
  • Keep pet food bowls indoors when possible.

5) Simple exclusion

If flies cannot get in, you do not have to “repel” them. A few physical barriers make a bigger difference than most sprays.

  • Repair window and door screens (including small tears at corners).
  • Keep doors closed during peak fly times, or use a magnetic screen curtain or self-closing screen door on busy patio entries.
  • Use mesh food covers any time food is out.

Plants people say flies dislike

Herbs and aromatic plants can help, but they are not a force field. Think of them as one layer in a bigger plan, especially near doors, patios, and compost bins.

  • Basil: great near seating, and you will actually use it in the kitchen.
  • Mint: strong smell, but plant it in a pot unless you want it everywhere.
  • Lavender: best in sunny, well-drained spots.
  • Rosemary: tough, fragrant, and useful for cooking.
  • Lemongrass (warm climates or pots): common in outdoor deterrent products.
  • Marigolds: not a guaranteed fly repellent, but can be a helpful part of mixed planting around seating areas.
A real backyard herb container with basil, rosemary, and mint growing on a sunny porch near a door

My rule: if you want to plant something for fly control, pick something you also want for cooking or pollinators. That way, even if the fly impact is mild, you still win.

Compost and trash

Compost piles and trash cans are top fly magnets because they combine odor plus moisture. Handle those two things and you usually cut fly numbers fast.

Cover fresh scraps

Do not leave food scraps exposed at the top of the pile.

  • Bury scraps under a few inches of finished compost, leaves, or shredded cardboard.
  • Add a dry “brown” layer every time you add wet greens.

Keep it balanced, not soggy

Compost that is too wet attracts more flies and can go sour.

  • If it smells bad, add more dry browns and turn it.
  • If it is dripping wet, you need more airflow and more dry material.

Use physical barriers

  • Keep lids closed on compost bins and trash cans.
  • Repair torn screens on compost tumblers or vents.
  • Rinse the inside rim of trash cans where gunk builds up.

Do not ignore pet and animal areas

Pet waste is one of the strongest fly attractants in a typical yard.

  • Pick up dog waste daily (twice daily if flies are heavy).
  • Rinse patios or runs where waste residue lingers, especially in warm weather.
  • Keep outdoor pet food sealed and bring bowls in after meals.
A closed outdoor compost bin on a gravel pad with leaves and shredded cardboard stored in a nearby lidded container

Fungus gnats

If you have tiny flies around seed starting trays, potted herbs, or houseplants, the fix is usually moisture management, not scent.

  • Let the top inch of soil dry between waterings when the plant allows it.
  • Bottom water seedlings and pots so the surface stays drier.
  • Use yellow sticky cards to catch adults and monitor if things are improving.
  • Top-dress with a dry layer like coarse sand or fine gravel to make egg-laying harder.

If you see cinnamon suggested: it may help a little by reducing surface mold (gnats feed on fungi), but it is not a dependable stand-alone control.

If the infestation is persistent, a biological option many gardeners use is BTI (often sold as mosquito dunks or bits) mixed into watering water. It targets larvae of fungus gnats and mosquitoes, not the adults. You usually need repeat applications per label directions to catch new hatch-outs.

DIY deterrents and traps

Deterrents help, but sometimes you need to remove active adults too. Traps work best when you place them away from where you sit, so you are pulling flies away rather than inviting them closer.

Apple cider vinegar trap (fruit flies)

  • Use a small jar with 1 to 2 inches of apple cider vinegar.
  • Add a drop of dish soap to break surface tension.
  • Cover with plastic wrap and poke small holes, or leave open in a low-traffic area.

Commercial fly bait traps (heavy outdoor pressure)

These can be very effective, but they smell awful up close.

  • Hang them downwind and away from doors and eating areas.
  • Place them near the source, like trash cans or animal areas, not next to your patio.

Fans and mesh (patios)

  • A fan reduces landings and hovering in many common fly species.
  • Food mesh covers help more than most sprays when you are eating outside.
A mesh food cover placed over a plate of sliced watermelon on an outdoor table in a backyard

Quick checklist

  • Pick up fallen fruit and compost it properly.
  • Keep compost bins and trash cans sealed and clean around the rim.
  • Cover fresh compost scraps with leaves or cardboard.
  • Fix leaky irrigation and soggy organic spots.
  • Use airflow on patios.
  • Use sticky traps for fungus gnats and vinegar traps for fruit flies.
  • Repair screens and use simple entry barriers.
  • Plant useful herbs near doors and seating for mild, close-range scent deterrence.

Common questions

Do flies dislike vinegar?

Not always. Fruit flies are often attracted to vinegar, which is why vinegar traps work for them. House flies are less reliably attracted. Use vinegar as a trap bait, not a general repellent.

Do flies dislike cinnamon?

Cinnamon is sometimes used for fungus gnats because it may reduce surface mold in potting mix. Evidence is mixed, and it is not a reliable control by itself. Moisture management and BTI are usually more effective.

Do flies dislike citronella?

Citronella can help at close range in outdoor seating areas, especially when combined with airflow and clean surfaces. It is not a cure-all if there is a strong breeding source nearby.

Why are flies suddenly so bad in my garden?

Usually it is one of these: overripe fruit on plants or the ground, an overfull trash can, pet waste, compost that is too wet, or a hidden moisture problem like a leaky spigot. Find the source first, then use deterrents and traps to finish the job.

Bottom line

Flies dislike losing their breeding zones more than they dislike any one scent. Start by drying out and covering the places they reproduce, then add helpful layers like airflow, mesh covers, repaired screens, and targeted traps. Once the source is under control, even simple steps can make your garden feel comfortable again.

Jose Brito

Jose Brito

I’m Jose Britto, the writer behind The Country Store Farm Website. I share practical, down-to-earth gardening advice for home growers—whether you’re starting your first raised bed, troubleshooting pests, improving soil, or figuring out what to plant next. My focus is simple: clear tips you can actually use, realistic expectations, and methods that work in real backyards (not just in perfect conditions). If you like straightforward guidance and learning as you go, you’re in the right place.

Share this: