1. Home
  2. Knowledge Centre

How To Keep Gnats and Fruit Flies Away from Your Garden

Written by: phs Greenleaf

phs Greenleaf has been providing planting and landscaping services to businesses for over 25 years, including indoor and outdoor plants, artificial and live planting, living walls, grounds maintenance and Christmas trees and decorations.

How To Keep Gnats and Fruit Flies Away from Your Garden

If you’ve invested a lot of time or money on your garden and floral displays, you’ll no doubt want to keep them looking their best. However, this will mean you’re likely to have to fight against two common garden pests; gnats and fruit flies. 

Gnats are renowned for striking just as you’re sat outside enjoying a warm summer’s evening. These pesky insects not only cause a nuisance but can bite too. Then we have the small yet pervasive fruit fly attracted to the first whiff of overripe garden fruit and veggies. So, what can you do to prevent these pests from infiltrating your garden? And if you’ve already got an infestation, how do you get rid of these swarms of tiny flies from your garden? 

Allow phs Greenleaf to shed some light.  

What are gnats and fruit flies? 

A gnat is a small flying insect with long legs and antennae. Gnats are small mosquitos and grow to around 8mm long. Usually grey or black, there are several species of gnat, some of which feed on fruit and vegetables and others preferring fungus, organic mulch and decomposed plants. They love warm summer weather and while they only live for up to two months, they can lay up to 1,000 eggs in their lifetime.  

Fruit flies are around 3-4mm in size with yellowy brown or reddish orange bodies, red eyes and two antennae. Most common in the late summer months, fruit flies are attracted to over ripe and rotting fruit and vegetables. They reproduce quickly, laying up to 500 eggs at any one time and can mate just a few days after hatching. This means if you have fruit flies in your garden, you’ll need to act fast before the situation before they start breeding uncontrollably.  

What are gnats and fruit flies attracted to in the garden? 

The reason gnats and fruit flies are common in gardens is that they provide plenty of opportunities for a bountiful banquet. And because these flies lay their eggs where they eat to provide food for their offspring, if you’re supplying a food source then you’re also giving them a green light to breed and multiply there too.  

If you start spotting gnats and fruit flies in your garden, you’re best off determining the root cause. Hunt out where they are most concentrated to discover just what they are feeding on. Are there any overripe fruit or vegetables in your garden which are providing an ample feast and a perfect breeding ground to lay eggs and feed their hatched larvae? Is your compost left out in the sunshine and slowly decomposing to create a warm, damp hot bed for these pests? Do you have soggy soil with rotting roots and plant matter? Are there any spots where water is allowed to pool and become stagnant? Or are any of your bins left exposed? All these examples are highly attractive to various species of gnat and fruit fly.   

How to get rid of gnats and fruit flies in your garden

To rid your garden of gnats and fruit flies most effectively, you need to remove their feeding and breeding ground. Disposing of waste and compost is straightforward but make sure you wash down the area afterwards such as cleaning bins, hosing down walls and floors and cleaning drains to make sure they’re free of any debris so you’re removing any eggs too. 

If you’ve discovered the flies are originating from any growing fruit and vegetables, you’ll need to prune these immediately. There’s no rescuing a juicy strawberry that’s full of fly eggs or pulsing larvae! Keep a close eye on the rest of your crop and harvest them before they get over ripe and become an attractive proposition to the flies.  

If you have tiny flies around your plants, it’s likely you’ll have fungus gnats which love to feed on fungus in damp soil. This means that the soil is essentially growing mould and rotting. Remove the affected soil and dispose of it, shipping out the bugs too and replacing it with fresh compost or soil. Rotting soil can be down to overwatering so consider how much water you’re giving your plants and reducing it. However, it could be because the area is simply not draining and becoming waterlogged. If it’s a plant pot, ensure that there are holes in the bottom to facilitate drainage but if you have a serious waterlogging issue in a flower bed you may need to install a drainage system. One tip can be to top your soil with a fine gravel or small decorative stones which not only look great but can help water to drain through.  

Inspect your plants to assess if they are just starting to attract a few flies or if you have a major infestation. If possible, inspect the roots. Any roots which are rotten or rotting – which will be squidgy, black and smelly – will need to be pruned off immediately. If you have a serious fly problem, replant your plants in fresh soil. 

After you’ve removed the home and food supply of gnats and fruit flies – or if you’re struggling to get rid of them and need a quick solution – consider laying a trap. You can buy insect traps or sticky strips and even chemical fly spray. But if you’re looking for a simple and more environmentally-friendly alternative, home-made traps are easy to make.  

How to make a trap for gnats and fruit flies 

To make a trap, pour some apple cider vinegar into a dish or jar with a few drops of washing-up liquid. The pests are attracted to the sticky sweet vinegar but as the soap reduces the surface tension of the liquid, once the flies land they can’t escape.  

If you don’t have apple cider vinegar, you can make a funnel trap. Place a piece of over ripe fruit, such as a banana, into a jar. Roll a piece of paper into a funnel shape and stick it together before cutting off the end to make a small hole. Pop this into the jar so that flies can fly down into the jar to get to the fruit and become trapped. You can also use a small drinks bottle; cut the top half off and turn it upside down and drop it into the bottom half of the bottom. For either trap, you could also cover it with clingfilm pierced with small holes instead.  

How to prevent gnats and fruit flies 

If you want to stop gnats and fruit flies from returning to your garden – or preventing them from coming in the first place – try taking the following preventative steps:  

  • Avoid overwatering so your soil doesn’t get soggy. Allow excess water to drain, not pool, and allow soil to dry out.  
  • Keep compost areas aerated and turned, covering them where possible.  
  • Empty any standing water sources such as buckets, pots, wheelbarrows, watering cans, kids’ water-play tables, blocked gutters and uncovered water butts. 
  • Remove food sources such as pruning fruit and vegetables before they get over ripe, clearing up decaying leaves and grass cuttings, covering bins.  
  • Deter flies with scent. Many of the smells that that gnats and fruit flies detest are ones that are fresh and fragrant for us humans. Think of Citronella which you can buy as garden candles, lanterns, waxes and oils as well as peppermint, lemon and lavender. You can mix these oils into a water spray and mist over any high-risk areas.  


More about phs Greenleaf 

phs Greenleaf provides planting and landscaping services to premises across the UK in a variety of sectors. This includes indoor planting, outdoor planting, artificial and live planting, living walls, ground maintenance and Christmas decorations.  

Find out more about phs Greenleaf today.  

Category Icon Calendar