How to keep ants out of a trash can
Ants are not interested in your trash can. They are interested in the sugar film on the inside of it, and in the trail the last scout left for the rest of the colony - which is why cleaning beats every other intervention here.
By Ryder M. · Last reviewed October 17, 2026

Lid & Liner is reader-supported. If you buy through a link on this page we may earn a commission at no extra cost to you. It never changes which product we rank first — how we pick and how we make money.
The short answer
Wash the can out properly, wipe the trail the ants are following, dry it, and then keep the food residue out of it - rinse containers before they go in and bag the wet waste. A lid that seats tightly helps, and raising the can off the ground so the only route up is one you can treat helps more. What the entomologists are clear about: if you need a pesticide, use baits placed away from the food waste rather than spraying, and never spray insecticide inside a container that holds food scraps.
The method
Step 01
Empty it and take it outside
This is a job for a hose, a shower or a yard, not a sink. Take the inner bucket out if the can has one, and take the lid off if it comes off - the two surfaces that matter are the bucket floor and the underside of the lid.
Step 02
Degrease, leave it, then brush
Sugar and grease residue is the actual attractant, and a dry wipe does not remove it. Sponge a diluted degreaser into the bucket, leave it a few minutes, then brush the corners, the lid rim and the pedal channel. Simple Green publishes a garbage-can dilution - about half a gallon of concentrate to half a gallon of water for a badly soiled can - which is a useful indication of how strong this job is.
Step 03
Wipe the trail, not just the can
Follow the line of ants back from the can as far as you can see it and wipe that path with soapy water or an enzyme cleaner: the floor, the baseboard, the cabinet edge, the step outside. This is the step people skip and it is the one that stops the recruitment.
Step 04
Dry it completely before it goes back
Ants need water as well as food, and a damp bucket in a closed can is an attractant in its own right in hot weather. Let both parts dry fully in the air.
Step 05
Change what goes in it
Rinse cans, bottles and jars before they go in - sticky residue in a recycling bin is the commonest ant source in a tidy house, and it is exactly what waste-handling guidance asks for in schools and commercial kitchens. Bag and tie wet food waste, or keep scraps in the freezer until collection day.
Step 06
Seal and raise the can
A lid that actually seats keeps the smell in, and smell is the advertisement. For an outdoor can, standing it on a paver or a stand rather than on soil or mulch removes the easy route up and means any treatment you apply has one place to work.
Step 07
If you need a pesticide, bait - do not spray
University extension guidance is consistent on this: baits in refillable stations are the safest effective do-it-yourself option outdoors, and they work with exclusion and sanitation rather than instead of them. Place them along the trail away from the trash, never inside the can, and never spray insecticide into a container that holds food waste. Follow the product label - it is the law and it is also the instruction manual.
Why your can in particular
Four conditions make one can an ant problem while the identical can next door is not. Work out which of them applies to you and you will usually have the whole answer.
- Residue the lid cannot hide. A film on the bucket floor and under the rim is a food source that is there between emptyings. It outlasts every bag you put in.
- Sugar going in unrinsed. Soda cans, juice cartons and jars are the classic source, and the recycling bin is the classic location - often a bin with no lid at all.
- A route the can gives them. Mulch, soil or a plant touching the can, or a can standing against a wall the ants already use. Extension guidance for houses is to keep plants, grass and mulch back from the foundation for exactly this reason.
- Water. A damp can, a leaking bag, or a saucer of condensation under the can. In a dry summer that alone is enough.
Note what is not on that list: the material of the can. A plastic can is not more ant-prone than a steel one. What matters is whether the lid seats, whether the inside is clean and whether the can gives them a path.
What to use
Two cleaners and, if the lid on your can does not seat properly, a can that latches. That is the whole shopping list - and notice that none of it is an insecticide, because the pesticide decision belongs with the label and with your local extension service rather than with us.
The degreaser for the residue, an enzyme spray for the trail and anything that still smells sweet, and a latching can if your current lid does not seat.

Best cleaner overall
Simple Green All-Purpose Cleaner
The degreaser we would reach for first: it breaks down the fat and food residue that actually makes a can smell, and Simple Green publishes a garbage can method for it.
Price as of October 17, 2026. #ad How we make money

Best enzyme cleaner
Biokleen Bac-Out Stain and Odor Remover
The enzyme option for residue that has soaked in — a bin that still smells after a proper wash, rather than one that is merely dirty.
$12.73 · 24% off · Price as of October 17, 2026. #ad How we make money

Best cheap locking can
Hefty 12 Gallon Step Trash Can with Lockable Lid
A plastic 12-gallon step can whose lid actually locks to the body — the cheapest honest answer to a dog or a toddler in the trash.
Price as of October 17, 2026. #ad How we make money
One honest caveat on the cleaners: Simple Green cleans but makes no disinfectant claim, and Biokleen's own label does not list trash cans among its stated uses - we recommend it for the residue chemistry rather than on the maker's say-so. The best trash can cleaners ranks the category properly, and the best bug-proof trash cans covers cans chosen for a sealing lid.
Keeping them out for good
- Rinse before it goes in. The single highest-value habit on this page, and it costs five seconds at the sink.
- Wash the can on a schedule, not on a problem. Once a month for an indoor can, and immediately after any leak. How to clean a trash can has the full method.
- Keep the wet fraction out. Freezer, caddy or a separate bag. How to stop trash can smell is built around this principle and it works on ants for the same reason.
- Stand an outdoor can on a hard surface. Off the soil and off the mulch, with a gap behind it rather than touching a wall.
- Check the lid actually seats. Press it closed and look for daylight at the rim. A warped lid is a standing invitation, and trash can lid replacement covers what can be fixed.
- Deal with the trail each time. If you see a line, wipe the line. It takes a minute and it is the difference between one visit and a season of them.
If the insects in your can turn out to have wings rather than six legs on a trail, you are reading the wrong page: trash can fruit flies and how to get rid of maggots in a trash can cover those, and both have a different cause and a different fix.
Common questions
How do I get ants out of my trash can?
Empty it, degrease the bucket and the lid rim, wipe the ant trail back from the can, dry everything fully, then rinse recyclables and bag wet waste so there is nothing to come back for.
Why are there ants in my trash can?
Because there is sugar or grease residue in it, and a scout has laid a trail the colony is now following. The material of the can is irrelevant; the residue and the trail are the whole problem.
Should I spray insecticide in my trash can?
No. Never spray insecticide inside a container that holds food waste. Extension guidance is to use baits in refillable stations placed away from the waste, alongside cleaning and exclusion.
Does a locking lid keep ants out?
It helps, because a lid that seats contains the smell that advertises the can - but it is second to cleaning. Ants will find residue in a sealed can through the smallest gap.
What keeps ants away from an outdoor garbage can?
Stand it on a paver rather than soil or mulch, keep plants back from it and from the wall behind it, rinse containers, and wash the can out on a schedule. Those remove the food, the water and the route.
Do ant repellents in the can work?
Putting a repellent inside the can is the wrong place for it - you want the food source gone and any bait outside the can, where the label says it belongs. Cleaning is what actually ends it.
Sources
Every specification on this page traces to one of these, checked at the time of writing. Where a manufacturer does not publish a figure, the page says so rather than estimating it.
- UC Statewide IPM Program - Pest Notes: Ants (sanitation, exclusion, baits in refillable stations as the safest effective DIY option)
- US EPA - Reduce school pests by properly handling waste (tight self-closing lids, rinsing containers, siting waste away from doors)
- Simple Green - cleaning garbage cans (published dilution and method)
- Biokleen - Bac-Out Stain and Odor Remover (enzyme and live culture formulation, stated uses)
Read next
- Odor ControlThe free fixes first, then filters, deodorizers and cans built to contain smell.
- The best bug-proof trash cansFive cans and traps picked on lid seal and interior cleanability - the two things that actually decide whether bugs breed in your bin.
- Trash can fruit fliesFind the breeding site first, then trap. The order is the whole fix.
- How to clean a trash canThe full method, including the underside of the rim everyone misses.
- How to get rid of maggots in a trash canBoiling water, safely — plus why they appeared overnight and how to stop it.
- How to stop trash can smellSeven steps in order, free ones first, plus the three places residue hides.
The author
Ryder M.
Owner and editor of Lid & Liner, published by Magoo Media Group. He started the site after getting tired of the same problem everyone has: every “best trash can” article covers ten products and none of them tells you whether a 13-gallon bag actually fits a 13-gallon can. Lid & Liner covers one category and tries to cover it completely.
Last reviewed October 17, 2026. Spotted an error? Tell us and we will correct it and note the correction.