Sumo Gardener

Maggots in Compost? Good or Bad? What you need to know

Learning how to make compost is the first step in the journey of being an eco-friendly gardener! The downside is that one day you may find that hundreds of tiny maggots in compost have invaded your compost pile or bin.

These unpleasant, wiggly guests are fly larvae, and can be an unwelcome guest especially in indoor compost bins. So, what do you do next? Is your compost still usable?

Should you get rid of the maggots? Here’s a guide on why maggots occur, how to kill maggots in compost and how to prevent them from coming back.


Maggots in Compost Good or Bad What you need to know

Why are Maggots Infesting Compost?

How to Prevent Maggots in Compost

As we’ve mentioned, these grubs are fly larvae. You can identify them because they are a pale grey-white in color with a dark head, are an inch long or smaller with a segmented body, and are very mobile and active.

The adult flies lay eggs in rotting matter, ensuring there’s a plentiful food source for when they hatch. Compost is the ideal place for them to lay their eggs because it’s moist, rich in decaying organic matter, and warm.

Are Maggots in Compost Bad?

As gross as maggots are, they are not harmful at all and are not dangerous to you or the environment. In fact, they play an important part in breaking down organic matter.

By eating your rotting fruits, vegetables and organic clippings, the maggots help support the process of producing healthy, rich compost. For that reason, some people don’t mind it if the maggots are in an outdoor compost pile. 

However, they are voracious eaters and obviously lead to an increase in adult flies, so most people choose to get rid of them – especially if they appear in an indoor compost bin.

Are Maggots Bad for Your Garden?

As we mentioned above, they are actually very helpful for breaking down organic matter in soil, which makes nutrients more easily absorbed by plants.

They also provide a food source for beneficial insects and bird life. However, a lot of maggots can be pretty unpleasant to deal with and can lead to a fly problem if birds and insects can’t feed off them.

Why Do I Keep Getting Maggots in My Garden?

By eating your rotting fruits, vegetables and organic clippings, the maggots help support the process of producing healthy, rich compost

Flies only lay eggs where there is a plentiful food source for their larvae, so chances are there is a good food source in your yard.

This may be pet or animal waste (they love cat, dog and horse waste), rotting fruit (often on or below fruit trees), or rotting vegetables, your compost bin, or if your garbage bins aren’t well sealed.

Once you eliminate those food sources and follow the instructions on preventing maggots in compost, your problem should go away.

Where do Maggots Come From if There are No Flies?

Since maggots come from the eggs laid by flies, then there are flies present – they’re just going unnoticed.

This is because tiny fruit and house flies are so small that they can get into small cracks around bins or under lids, and the eggs they lay can’t be seen by the naked eye.

Sometimes, they can even get into your home or bin on unwashed fruit and vegetables.

There are several ways to kill maggots in compost – simply try them out and choose the method that is easiest for you and gives you the best results.

Add More brown/Organic Waste 

The first method to try for getting rid of maggots in compost is to add a layer of brownorganic waste

The first method to try for getting rid of maggots in compost is to add a layer of brown/organic waste (carbon rich waste like grass clippings, leaves, cardboard egg containers, etc.) to the top of your compost.

Stop Feeding the Maggots 

Your food waste is premium maggot food, so if you take away the food source, the maggots will die off too. The best thing to do is to start a second compost pile or bin and focus on that one.

Put a layer of brown matter onto the pile that’s affected by the maggots and either let it sit or turn the compost, but don’t add any more food waste to it.

Attract Birds to Eat Maggots 

Birds love to eat maggots, so this is a great, eco-friendly way of getting rid of maggots in compost! You can shovel the maggots out of your compost, take the lid off or spread it out and let the local birds go wild.

As long as the birds have access to the maggots, they’ll eat them all up. 

Using Lime to Raise your Compost' pH.

Maggots don’t like a high pH environment, so changing the pH of the soil can make it undesirable, preventing flies from laying eggs there and causing existing maggots to die or leave.

You can test the pH of your compost first with a pH kit. To raise the pH, you can add one cup of lime for every 25 cubic feet of compost.

You can also add pine needles or citrus peels for a natural alternative. Remember that this compost can then only be used on acid-loving plants.

Will These Techniques Get Rid of Earthworms Too?

We’d recommend that you don’t remove earthworms at all if possible, as they are desirable beneficial creatures for your garden.

However, if you do want to get them out of your compost, the methods described above will work just as effectively as they do on maggots.

How to Prevent Maggots in Compost

How to Kill Maggots in Compost

Only Compost Certain Organic Products

The first step is to only put the correct organic waste into your compost bin or pile.

This will create a healthy environment that isn’t as appealing to flies. Items to put in your compost include:

Do not put the following in your compost bin:

  • Dairy products
  • Meat or fish products
  • Dog or cat waste
  • Diseased plants
  • Weeds

Maintain a Healthy Compost Ratio

A healthy compost pile will have a ratio for 2:1 green material to brown material. This means that for every layer of food waste (which is very attractive to flies and high in nitrogen.

There should be half as much other brown/organic waste (carbon rich waste like grass clippings, leaves, cardboard egg containers, etc.).

You can make your compost bin much less attractive to flies by adding a layer of brown/organic waste every time you tip your food waste in, creating a physical barrier for the flies as well as making your compost less appealing to flies overall.

A good idea is not to add your grass clippings all at once. Rather, keep a pile at the side of your compost bin so you can top up your compost whenever you add food waste.

Don’t Pile in Grass Clippings All at Once

Thick layers of newly cut grass clippings quickly become moist and smelly – and very attractive to flies. Rather spread out your clippings and let them dry, adding them a bit at a time as you balance out your kitchen waste.

You can also mix your organic kitchen food waste with dry items like newsprint and cardboard to help stop too much moisture from accumulating.

Add Vinegar to Your Compost

Many garden enthusiasts swear by adding a tablespoon of vinegar per 20 pounds of compost to prevent flies and maggots.

Install Fly Traps Near Your Compost Bin or Pile

A Woman Attaching a Disposable Outdoor Hanging Fly Trap

Source: Amazon

Whether your compost bin is indoors or outside, it’s a good idea to put a few fly traps and strips nearby. This will draw any flies attracted to the compost, trap them and prevent them from laying eggs in your compost bin or pile. This is especially important to do in rainy, warm seasons.

Closed VS Open Compost Bins – Which is Better?

Image of a Classic Compost bin

Source: Amazon

Flies come in all shapes and sizes, and they are all very determined to get to that organic waste, so both closed and open bins can develop infestations of maggots.

Preventing maggots is all about using these bins properly.

Open Air Compost Bins

Here, you need to layer your compost properly, following the 2:1 ratio of food/green waste to organic/brown waste that we mentioned above.

Other good tips to prevent maggots in open compost bins include not adding water to your compost pile, turning your compost regularly, and covering the top layer with newsprint or cardboard.

Closed Compost Bins

Closed bins are good because they seal off the compost from passing flies, so they can often be better protected from maggot infestations. However, flies can still find their way in, or even lay eggs in waste before it’s added to the bin.

With these bins, the best way to prevent maggots in compost is to ensure liquid can seep out at the bottom of the bin, as the smell and the moisture really attracts flies.

You have to turn your compost often, as the closed environment makes it easy for moisture and heat to build up.

Don’t add water unless really necessary, and try adding more dry organic matter like leaves, newsprint, cardboard egg containers and dry grass clippings.

See our review on the best compost bins and tumblers for 2023 here

Preventing Maggots in Indoor Compost Bins

Example of an Indoor Compost Bins

Source: Amazon

Indoor compost bins are very convenient, allowing you to get vegetable peelings, eggshells and fruit peelings cleaned up and out of the way.

However, they can get a bit smelly and start attracting fruit flies and other types of flies – and that’s how you end up with maggots. Here’s how to prevent maggots in compost bins.

  • Keep a stash of shredded newsprint nearby and add a handful every time you top up your compost bin.

    This will stop it from getting too soggy and it will start the process of adding carbon to your compost.
  • Don’t add meat, fish, dairy products, onions or citrus. These will smell really badly as they start to rot, and it attracts a lot of flies quickly.

    Stick to vegetable peelings, fruit scraps, eggshells, coffee and tea leaves. Try to cut large items into smaller pieces, as these break down faster.
  • Turn your compost often. This encourages microbial action and helps avoid soggy and dry spots from forming. You can use a hand trowel or even just shake it a bit.

    If you are using your indoor compost bin to collect scraps that you then put into your outdoor bin, be sure to empty it regularly – every 2 days or so – as this will help discourage flies and prevent maggots in compost.

Now You Know How to Get Rid of Maggots and Prevent Maggots in Compost!

While maggots are unpleasant and not at all fun to have in your home or garden, they aren’t harmful. Getting rid of maggots is pretty easy too – you can dig them out of compost and let the birds eat them or you can raise the pH level of your compost. 

You can prevent maggots in compost quite easily by keeping to a 2:1 ratio of food waste (vegetable and fruit peelings, eggshells, tea leaves and coffee) to brown waste (cardboard, dry grass clippings and newsprint).

Don't forget to regularly turn your compost, don't add water, and don't add any dairy, meat, fish or pet waste to your compost. We hope this guide has helped you deal with the problem of maggots in compost bins – happy composting!

About the Author Ann Katelyn

I'm Ann Katelyn, Creator and Chief Author of Sumo Gardener. Since I was a child I've always been fascinated with plants and gardens, and as an adult this has developed into my most loved hobby. I have dedicated most of my life to gardening and started Sumo Gardener as a way to express my knowledge about gardening with the hope of helping other people's gardens thrive.

follow me on:

Leave a Comment: