How to Get Rid of Ants in Compost

Dear Home Ec 101,

Every time I have tried composting, it gets full of ants and I freak out and spray the compost pile. That’s probably not so good, eh? Is it okay for a compost pile or bin to be full of ants?


Scared There’ll be Ants in My Pants¹

Heather says:

I hadn’t experienced this phenomenon so it was off to the garden forums and county extension office for advice. The answer depends partly on where you live.

In some parts of the country where ants avoid moist areas, that may be prone to flooding, getting rid of ants in a compost pile may be as simple as turning it occasionally and keeping it damp. In other, drier place, they are attracted to moisture. If you live in an area with fire ants, please use a long handled rake and wear closed toe shoes before even approaching the pile.  Having your feet full of ant stings can make for a miserable few days. A hazmat suit and galoshes would probably be better, but most of us don’t have that laying around.

If fire ants are a problem, look for ant baits that contain spinosad, this is available in several organic ant baits. This organic method of fire ant control, works best when it’s an attractive alternative to your compost pile. What would make it attractive? Proximity to the nest in most cases. Follow the ant trail, if you can. Distribute the bait on a dry day when it isn’t likely to rain for at least twelve hours, if you’re in Florida that may be an issue, I get it.

I’ve never had a problem with ants in my compost pile, while they are all over my yard. The reason? My passive compost pile has an obscene amount of coffee grounds, which ants don’t seem to like. If you are not a coffee drinker, try asking your local Starbucks for grounds. If you have a local shop, talk to the owner, they may also be willing to get rid of their used grounds.

If you have invested in a compost tumbler, you can try setting the legs in buckets of water. Ants typically won’t swim for their snacks.

If it’s just a few ants, the answer may be as simple as burying any kitchen scraps in a few inches of other material making it less accessible to the six-legged scavengers.

Good luck!

¹Ants in my pants, ants in my pants, lookin’ like a fool with ants in my pants. I don’t even watch American Idol and the Pants on the Ground song has been stuck in my head forever.


  1. Christy on March 13, 2018 at 12:15 am

    Can the ants kill my worms in my compost? And how would you recommend getting the ants out without killing the worms I have left? The compost is moist but not to wet. I’m not sure what kind of ants we just moved to central Texas.

  2. Dolly Galbreath on April 30, 2016 at 3:36 pm

    I understand your are correct “Orwell” , but these are fire ants and I love what these ants are doing but what do I do when I’m ready to use the compost. , or will the ants leave when there is nothing else left except “”good dirt” and turning things over gets painful when we get stung each time.

  3. JDinFL on March 30, 2014 at 11:51 am

    I just started my new compost bin with an open bottom by digging up some of the sandy soil under where I was going to place it and mix in some garden soil. I then started it with a little kitchen compost and soaked strips of newspaper. I also topped it with a opened bottom cylindrical cover with a lid I ordered by mail and added the european red worms I mail ordered to help make it better. The next day, I discovered the compost to be full of ants! Following instructions, I added more moisture to the compost without making it soffy, as I read ants prefer drier soils. I also found pre-baited ant trays that include Terro liquid ant bait, found the trail going into the compost pile, and placed the tray there. No poisons, just borax and a sweetener to attact them. Between the moisture and the bait, the ants stopped going into the compost and the worms are still alive!

  4. Anagha Comar on October 2, 2012 at 9:22 am

    Wow that was strange. I just wrote an really long comment but after I clicked submit my comment didn’t show up. Grrrr… well I’m not writing
    all that over again. Anyways, just wanted to say fantastic blog!

    • Heather Solos on October 2, 2012 at 11:56 am

      Ugh so sorry that your comment was eaten. I did try to email you that I was looking into it. I’m working on a few things in the back end today. So it may have happened at that time.

  5. orwell2112 on May 6, 2012 at 4:24 pm

    It always amazes me why people get concerned with living organisms appearing in their compost piles. Oh no – ants! Ants that – let’s see – break down material (in other words, compost). Ant poop is just as nutritive as cow poop and earthworm poop. But, for so many, it’s just too much fun to kill things.

  6. Lisa on March 31, 2012 at 10:08 pm

    Mix Orange oil 2 Tablespoons to 1 gallon water and drench ants with this.  Repeat as necessary.
    Kills them quite fast and because it is organic will not defeat the purpose of compost.  Works well
    on fire ants.

  7. naoumin on February 1, 2011 at 4:16 pm

    Smoked tomacco buds contain nicotine which is a pesticide..I am a smoker so I use the buds(just make sure to remove the buds)
    I have never had insect problems with my compost perhaps for this reason !
    My recent post Giant Isopod

  8. Keter on September 15, 2010 at 4:39 pm

    For any crawling insect problems, a line of diatomaceous earth around the problem area solves it. DE is nontoxic to other living things.

  9. Alex Foster on September 15, 2010 at 6:14 am

    Oh yes, it seems like a lot of insects or pests don't like coffee grounds. Besides ants, I also discovered that cockroach hates them too! Coffee grounds are my best natural pesticides. 😛

  10. @JayMonster on September 14, 2010 at 4:46 pm

    There are two times when ants become a problem, one when the green stuff is "too available" as you mentioned, or there is a lack of it (@MrsBYork mentions). This may be where being "obsessive" comes in a bit handy, but if you use your "green" scraps (veggies, egg shells, coffee grounds, etc) and bury it in with whatever dry stuff (dried leaves, soil, or just the bottom of your compost pile) you already have, then the compost pile generates heat as it breaks down the "green stuff" Since it is not uncommon for the pile to then be 145 degrees or more, that is generally too hot for the ants. Now I realize this makes it a bit more than "passive" composting… but you don't have to constantly turn it… just every once in a while, to maintain the pile and avoid the ants.

  11. @MrsBYork on September 14, 2010 at 7:28 am

    Ants in a compost bin/ heap are generally a sign that it's too dry – making sure to include a good proportion of "green" material, or just tipping on a can of water once or twice a week, should cure it. If you still have problems, Nemasys make a nematode product to repel ants (though I do not know if it's available in your region), see

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.