Several common herbs and garden plants produce volatile compounds that flies find repulsive, and a few perform surprisingly well in lab tests. Catnip is the standout performer, with its essential oil achieving 96% repellency against stable flies and 79% against houseflies at tested doses. But it’s not the only option. Basil, lavender, mint, and a handful of other plants release aromatic compounds that can help keep flies away from porches, kitchens, and outdoor dining areas.
How Plant Scents Repel Flies
Flies navigate the world largely through smell. Their antennae are covered in receptor neurons that detect airborne chemicals, and their brains sort those signals into “approach” or “avoid” categories. When a plant releases volatile organic compounds into the air, those molecules land on the fly’s odor receptors. Some compounds activate avoidance pathways directly, while others jam the receptors flies use to locate food sources, effectively masking the signals that would draw them in.
This is why simply having a plant nearby can make a difference. The scent doesn’t need to be overpowering to you. Even concentrations below what your nose easily picks up can interfere with a fly’s ability to find its next meal. Crushing or brushing the leaves releases a stronger burst of these compounds, which is why many of these plants work better when you disturb their foliage rather than just letting them sit untouched.
Catnip: The Most Effective Option
Catnip (Nepeta cataria) consistently outperforms other plant-based fly repellents in research. The active compounds, two forms of nepetalactone, make up about 90% of the plant’s essential oil. In laboratory bioassays, catnip oil repelled 96% of stable flies at a 20-milligram dose and 86% of houseflies at just 2 milligrams, a dose ten times lower. Comparative studies have found catnip oil to be as effective as, and sometimes better than, DEET and citronellal at repelling houseflies.
Catnip is a hardy perennial that grows easily in most climates and tolerates poor soil. The downside: if you have cats, they will roll in it, chew it, and flatten it. Plant it in a hanging basket or elevated container if you want it to survive neighborhood cats. For fly control, place pots near doorways or outdoor seating areas where flies tend to gather.
Basil
Basil is one of the most practical fly-repelling plants because you probably already want it in your kitchen. It releases its scent continuously without needing to be crushed, unlike many other herbs. Sweet basil contains compounds like linalool and eugenol that flies avoid. It works especially well near food prep areas, where flies are most drawn.
Basil is sensitive to cold. It cannot survive temperatures below 50°F, so bring it indoors before nighttime temperatures drop in fall. It thrives in full sun and needs at least six hours of direct light daily. On a windowsill, it does best with southern exposure.
Lavender
Lavender’s strong floral scent, driven by linalool and linalyl acetate, repels flies, moths, and mosquitoes. It works well planted along walkways, near windows, or in pots flanking a doorway. Dried lavender bundles hung near windows retain their scent for weeks and continue to deter flies even after the flowers are no longer fresh.
Lavender prefers full sun and well-drained soil. It’s drought-tolerant once established, making it low-maintenance for outdoor use. Indoors, it struggles without very strong light, so it’s better suited for porches, patios, and garden borders.
Mint and Peppermint
Mint plants produce menthol and other terpenes that flies strongly dislike. Peppermint is particularly potent. The downside is that mint spreads aggressively. Plant it in containers rather than directly in garden beds, or it will take over. A pot of mint near your back door or on an outdoor table provides a zone of scent that discourages flies from lingering.
Mint tolerates partial shade better than most fly-repelling herbs, making it a good choice for spots that don’t get full sun. It also grows well indoors on a bright windowsill. Pinching the stems regularly encourages bushier growth and releases more of the aromatic oils.
Other Plants Worth Considering
- Rosemary: Its woody, camphor-like scent repels flies and several other insects. It thrives in full sun and dry conditions, making it ideal for sunny patios. Rosemary grows well indoors near a south-facing window.
- Citronella grass: The classic mosquito plant also deters flies. It’s a large, clumping grass that works best in outdoor containers. The citronella you buy as small potted “citronella plants” (often scented geraniums) is far less effective than true citronella grass.
- Marigolds: Their pungent scent comes from pyrethrin-related compounds. They’re useful as border plants around vegetable gardens and patios. Flies, aphids, and whiteflies all tend to avoid them.
- Lemon balm: A member of the mint family with a strong citrus scent. It tolerates low light better than most herbs, needing only two to six hours of direct sun, which makes it one of the easier options for indoor growing.
Growing Fly-Repelling Plants Indoors
Most of these herbs need at least six hours of direct sunlight. A south-facing window is the best indoor location. If your windows don’t provide enough light, positioning plants 6 to 12 inches below two 40-watt fluorescent bulbs for 14 to 16 hours can substitute for natural sunlight. Rotate pots regularly so all sides of the plant receive even light.
Keep indoor herbs in rooms between 65°F and 70°F during the day, with nighttime temperatures no lower than 55°F to 60°F. Use containers with drainage holes and a potting mix designed for good water drainage. Herbs are more susceptible to root rot than many houseplants, so overwatering is a bigger risk than underwatering.
Humidity matters too. Indoor air, especially in winter with heating running, tends to be very dry. Grouping pots together creates a more humid microclimate around the plants. Setting containers on a tray of moist pebbles also helps. On the other hand, too much humidity without air circulation invites fungal problems, so don’t pack plants into a closed corner with no airflow.
Maximizing the Repellent Effect
A single potted basil plant won’t create a fly-free zone across your entire patio. These plants work best when you place them strategically: near doorways, around seating areas, and close to food. Grouping several different species together compounds the effect, layering multiple scents that flies dislike.
Brushing or pinching the leaves as you walk by releases a stronger burst of volatile oils. Some people strip a few leaves and rub them on table surfaces or tuck sprigs into centerpieces during outdoor meals. This improves performance noticeably compared to leaving the plant undisturbed.
For indoor use, placing herbs on the windowsill nearest your kitchen or wherever flies tend to enter gives you the most practical benefit. Keep in mind that live plants provide a gentler, more diffuse effect than concentrated essential oils or sprays. They reduce fly activity rather than eliminating it completely. In areas with heavy fly pressure, plants work best as one layer of defense alongside screens, cleanliness, and proper food storage.
Pet Safety Considerations
If you have dogs or cats, be cautious about which plants you choose. Geraniums (including citronella-scented varieties), peppermint, lavender, some marigold varieties, and garlic can all be harmful to pets if eaten. Catnip is safe for cats but may lead to destroyed plants. Basil and rosemary are generally considered safe around pets, making them better choices for households with animals that like to nibble on greenery. If you want to use a potentially toxic plant, place it in a hanging basket or on a high shelf where pets can’t reach it.