Plants that repel fruit flies – 5 herbs to help keep these pests at bay

Try growing these fragrant herbs in a kitchen planter or window box

potted herbs on windowsill
(Image credit: MarianVejcik / iStock / Getty Images Plus / Getty Images)

Q: Fruit flies are being a nuisance in my kitchen. I'd like to get rid of them naturally and have heard some types of potted plants can help. Which ones would you recommend?

A: Fruit flies are annoying and can also spread bacteria, so it's worth taking steps to repel them. The best course of action is to address whatever's attracting them, be it a full trashcan or a bowl of overripe bananas. But, as an extra layer of defense, there are a few herbs said to help ward them off.

Besides deterring pests, growing herbs indoors also means they'll be easy to access if you want to use them in your cooking. And, if you don't have the space on your countertop, you could plant them in a kitchen window box instead. Below, you'll find five recommendations to try, plus quick tips on how to keep them healthy.

potted herbs on shelves in kitchen with apples

Potted herbs can add aesthetic appeal to your kitchen

(Image credit: Elena Noviello / Moment / Getty Images)

5 plants that repel fruit flies

These kitchen plants should help keep these pests at bay, while adding a splash of fragrant greenery to your home.

1. Basil

indoor basil plant in metal container

The strong scent of basil may help keep fruit flies away

(Image credit: Neustockimages / iStock / Getty Images Plus / Getty Images)

Rebecca Sears, a gardening expert from Ferry-Morse, says, 'One of my must-have herb recommendations is basil as it’s easy to grow and provides fresh sweet and spicy leaves for your favorite meals throughout the season. Its strong aroma can not only help your kitchen smell great, but it can also help repel fruit flies.' 

She recommends placing the plant near your fruit to help keep pesky bugs away. Somewhere with plenty of light is best. 'Soil should be kept consistently moist but not waterlogged. Maintain a pH of 6.0 to 7.5, which can easily be determined by using a soil test kit,' Rebecca says. Soil tests are available from Walmart.

Top tip: Jerry Eason, the owner of The Diamond Exterminators and Crawlspace Solutions, says, 'Regular pruning encourages growth and releases more of the plants' natural oils into the air, enhancing their ability to keep fruit flies away.' That's more reason to harvest basil for your pasta and pizzas, then!

Rebecca Sears
Rebecca Sears

As CMO and resident green thumb for the Green Garden family of brands, Rebecca Sears nurtures the company's heritage but also looks to develop new products and solutions to help gardeners of all skill levels fuel their passion and become more successful in the garden. Rebecca has been gardening from coast to coast, first realizing her passion while living in Portland, Oregon, inspired by the public gardens throughout the city. When she relocated to the northeast, she built upon her knowledge and craft, and now her backyard garden grows larger each year.

2. Rosemary

rosemary in metal pot

Keep your rosemary plant somewhere sunny

(Image credit: Ursula Alter / Photographer's Choice RF / Getty Images)

A sprinkling of rosemary is excellent for elevating your roast potatoes or homemade bread, and its strong scent is said to help keep fruit flies away.

Grow rosemary indoors in pots with good drainage, or in a sunny planter near your door or window – its springtime blue flowers will attract butterflies. You could also hang up handfuls of fresh sprigs to intensify the pest-repelling effect and bring a rustic farmhouse look to your kitchen. 'Tuscan Blue' rosemary plants are available from Nature Hills.

3. Lavender

lavender plant in purple pot indoors

The aroma of these pretty plants may be pleasing to us, but it's unattractive to fruit flies

(Image credit: Almaje / iStock / Getty Images Plus / Getty Images)

Rebecca says the essential oils in lavender’s leaves and flowers contain linalool and linalyl acetate compounds that provide its scent. 'While this distinctive scent is pleasant to many, it’s too strong for fruit flies and acts as a natural repellent.'

Jerry also recommends planting lavender to help repel fruit flies. 'Lavender needs a lot of light, so place it in a sunny spot. It’s ideal for a bright kitchen window,' he says. 'Water sparingly, allowing the soil to dry out between waterings.'

We love the compact 'Hidcote' lavender, available from Nature Hills, which would look gorgeous in a sunny window box. Be sure to read up on how to prune lavender to keep it healthy for longer.

4. Sage

sage plant in terracotta pot indoors

Sage is a versatile cooking ingredient

(Image credit: KaterynaSednieva / iStock / Getty Images Plus / Getty Images)

Sage (Salvia officinalis) is a great herb for adding depth to savory dishes  – try harvesting the herbs for Christmas cooking. And, its distinctive aroma is said to help repel fruit flies, too. 

Like lavender, avoid overwatering sage, otherwise you'll risk it developing root rot. Keep it somewhere with plenty of sunshine, too, to prevent it from growing leggy. Sage seeds are available to buy from Burpee.

5. Peppermint

indoor mint in rattan pot

Mint is particularly well-suited to pots due to its naturally rapid growth

(Image credit: Zolga_F / iStock / Getty Images Plus / Getty Images)

The scent of peppermint is highly disliked by fruit flies, says Rebecca. What's more, she highlights how growing peppermint indoors and outdoors is easy, making it a great herb for beginner gardeners or home chefs who love to cook with fresh ingredients. It's also a lovely option if you're interested in growing your own herbal tea.

'Peppermint spreads horizontally, so choose a wide pot with good drainage to provide your plant with ample space,' Rebecca says. 'This plant also prefers a moderately humid environment and moist, but not soggy, soil.'

Jerry also recommends growing mint to help repel these pests, noting how it prefers partial to full sunlight. It can thrive in a kitchen window box, he adds.

FAQs

What attracts fruit flies?

Ben Hottel, an entomologist of pest-control service Orkin, says, 'Fruit flies are attracted to ripe or rotting produce, as well as fermented items like beer, wine and liquor.

'That’s why the best way to prevent fruit flies is to use produce before it rots,' he advises. 'You should also store food in air-tight containers, keep the kitchen clean of rotting food, and sanitize trash cans and drains regularly.'

Can plants that repel fruit flies help repel other pests, too?

Some fragrant herbs, such as lavender, basil, and mint, are also known as mosquito-repellent plants and smells that ants hate. As well as planting them indoors, try growing them in patio pots to boost the sensory appeal of your space.


Looking for more planting solutions to tackle unwanted bugs? These flowers to plant in a vegetable garden to deter pests are worth checking out – plus, they'll up the aesthetics of your homegrown patch.

Contributing Editor

Holly started writing about gardening nearly four years ago for Gardeningetc.com. She is now a regular contributor to Homes & Gardens and has written many gardening features for Woman & Home and Real Homes online, too. She has previous experience as a professional gardener in the UK, where she helped to plant and maintain private gardens. Holly has also looked after allotment plots over the years and loves to grow her own flowers and veggies from seed. In her spare time, she enjoys visiting local gardens, botanical drawing, and tending to her ever-growing collection of houseplants.