How to Get Gnats Out of Your Compost (Step-by-Step Guide)

Using stick tape to catch fungus gnats

You have your compost all set up and it’s doing the work it needs to, but now you’re attracting gnats. So the age-old question is: how do you get rid of gnats from your compost bin?

Getting rid of gnats in your compost is simple. You can remove them in seven easy steps. You’ll need to bury your waste underneath the soil, turn your pile, check your ratio of browns and greens, change your moisture level, use OR remove your lid, set traps, and then repeat each step until the problem is gone.

Let’s take a closer look at each step.

* This post contains affiliate links.

Bury Your Waste Underneath Soil

The very first thing you want to do is bury your waste underneath soil. This waste is what’s attracting the gnats to find their home in your compost. They love the food, so the best thing you can do is make sure it’s buried deep whenever you add new scraps.

When adding your waste to the pile, make sure you cover it with a hefty heap of soil. This will work as a deterrent for the gnats and make it harder for them to reach the food source due to the soil covering up the smell.

Turn Your Pile (and Keep Turning It)

This is important because the oxygen that enters your pile when you turn it will encourage the contents to decay faster. The faster your pile reaches completion, the less appealing your compost will be to gnats!

Turning your pile also heats up the compost faster, which again, is going to help all of the good bacteria and organisms go in and break down the materials faster than if you just left things stagnant.

Check Your Ratio of Browns to Greens

The next step you’ll want to take is to check on your ratio of browns and greens in your compost pile. You’ll know you have too many greens in your compost pile if you’re getting a very pungent and “unfresh”smell coming off it. Plus, you’ll probably have some gnats buzzing around as well.

If you notice that your pile is more green than brown, adjust your ratio by putting more leaves, newspapers, twigs, or soil into the mix. Browns should make up at least half of your compost bin compared to greens.

So, where can you get all of this brown material? Well, I would recommend you start keeping your daily newspaper handy. Instead of throwing it into the recycling bin, just keep a pile of it to place inside your compost bin!

For even more brown, you should go and pick up some twigs, as well as dig up some fresh and quality soil to mix in with your compost. If it’s in the fall, you’ll have PLENTY of leaves that will be on the ground where you can go up and place them in your bin to get things rolling.

Oh, and when you add in new brown material, make sure you turn the pile with it!

inside of a composting container

Look at the Moisture Level

Gnats LOVE water. Well, they love dampness, but still. In reality, gnats need a damp environment to survive and prosper.

If your pile is too moist, not only does it attract gnats but it can cause other issues as well. The best way to fix this is to turn the pile more frequently to allow more air to circulate throughout. Basically, this is going to keep things drier and help the whole pile breakdown quicker.

If that doesn’t work, you’ll want to dig out your pile completely and improve the drainage for the compost in order to ensure it doesn’t hold onto that water from your green material. Too much water is a BIG no in composting. Another way to combat too much water/dampness is to add in more dry brown material, as well.

If You Use a Lid, Remove It! If You Don’t, Use One!

There are instances when both using a lid and removing the lid has helped with a gnat problem.

If you use a lid, not only can it trap the gnats inside, but it can also provide the gnats with the dark environment they need for their eggs to hatch. Once that happens, they have the food source they need to thrive inside the pile.

Removing the lid will allow for more air to reach the pile and will help keep the pile from getting too moist.

If you don’t use a lid and you’re having a gnat problem, sometimes adding a lid or cover to your pile will help control the flies if they haven’t laid their eggs inside the pile.

Really, you need to look at your CURRENT situation and try the opposite. Mostly because what you’re doing just isn’t working right now.

Set Out Traps

This step really helps if you’ve done everything you can to make sure your pile is balanced and isn’t too moist. Taking an offensive stance when it comes to your gnat problem could potentially be the only thing you need to worry about.

Using traps in accordance with the steps listed above will be a great 1, 2 combo to help keep gnats away from your compost bin for GOOD (or until they come back).

Apple Cider Vinegar

Gnats really love the smell of apple cider vinegar. We’ve used this at home before. Simply get some apple cider vinegar at your local market (or here to make things simpler) and put a few drops of dish soap inside the vinegar to make a slippery and effective trap.

Get a Gnat Trap

Well, this one is simple. Just get a gnat trap! This 20-pack of Dual Sided Sticky Traps from Faicuk is a starting point when looking for traps.

Have you ever used a fruit fly trap? These are very similar to set up. Basically, the gnats go and are attracted to the scent that’s on the trap. They end up flying directly into it, helping to eliminate the problem in most cases.

The problem with both Apple Cider Vinegar and Gnat Traps are, however, is that if you don’t get rid of the source of the problem (the steps above) then you’ll keep running through these traps, because more gnats will show up.

Repeat Each Step Until Gnats Are Gone

The last and final step. You’ve made it.

It won’t happen overnight (unless you do a really good job), so it’s important to repeat each step until the gnats are gone. Set a schedule to turn your pile regularly and make sure you’re burying your waste, mixing browns and greens, and keeping that airflow mint!

Cobwebs with small gnats in the park, selective focus.

Other Gnat Repelling Tips and Tricks

If the steps above haven’t quite done the job yet, here is a list of some extra gnat repelling tips and tricks.

Boil Water

There are some who claim tossing boiled water throughout the compost will help get rid of the gnats and their eggs. The high temperature of the water makes it difficult for them to survive.

Much like when you use a steamer to get rid of bed bugs, carpet beetles and their eggs, the high temperature really does a number.

Use Butcher Paper or Newspaper to Wrap Your Kitchen Waste

Wrapping your kitchen waste in something that will decompose will add an additional barrier between the gnats and your compost. This will make it unappealing to the gnats and deter them from making their home there. 

You could also use something like a newspaper, which usually takes 1-2 months to completely break down. Recycling baby!

Chop Up Your Kitchen Waste

Chop, chop, chop it up. Any kitchen waste, you have, you should chop it up prior to putting it in your compost bin. Think of it like digestion – we chew our food so it breaks down easier.

Chopping up your kitchen waste will make the compost pile easier to decompose, which gets things moving a little faster.

Speeding up the process will eliminate the food source for the gnats, and hopefully, keep them away from your compost.

Other Common Bugs Found in Compost

Bugs are all a part of the composting process. Some bugs are harmless, while others can be bad for your garden if they travel with the compost.

You may also find:

  • Beetles
  • Bees
  • Fruit Flies
  • Maggots
  • Rodents

All going into your compost. Of course, that list isn’t exhaustive, but you’re definitely going to run into some of those critters and potentially depending on how long you plan on composting for.

Over your composting career, you’re going to see many crawlers, rodents, flies and critters come snooping around your compost bin. It’s up to YOU to keep them away, unless you really want them there, of course!

That’s a Wrap!

You now have seven easy steps to get rid of those pesky gnats from your compost. You just need to bury your waste, turn your pile, check your balance, keep it damp (NOT WET), remove (or put on) a lid, set out traps, and then repeat all of it until the flies are gone. It’s as simple as that!


Cloonan, K. R., Andreadis, S. S., Chen, H., Jenkins, N. E., & Baker, T. C. (2016). Attraction, oviposition and larval survival of the fungus gnat, Lycoriella ingenua, on fungal species isolated from adults, larvae, and mushroom compost. PloS one, 11(12), e0167074.

Dennis, D. J. (1978). Observations of fungus gnat damage to glasshouse cucurbits. New Zealand Journal of Experimental Agriculture, 6(1), 83-84.

How to pest proof your home in under a day e-book by Zack DeAngelis

Download My Free E-Book!

 Take a look at my guide on Pest Proofing Your Home In Under a Day! I get into the nitty-gritty on the most common types of pests you’ll see on your property including BOTH insects and wildlife, along with the specific signs to look for regarding any pest you have questions about.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *