Last updated: August 22, 2026
The first sign is one small moth flying a lazy circle near the ceiling. You wave it away. A week later there are three, and then you find the webbing: a fine silk mat in the corner of a bag of cornmeal, or a clump of oats stuck together on the shelf. By that point the moths flying around the kitchen are the last stage of something that has been happening quietly inside a package for weeks.
Pantry moths are frustrating because the visible insect is not the problem and killing it does nothing. The problem is an infested food package you have not found yet, and the fix is a systematic clear out followed by containers that keep the next batch from spreading. That order matters, and skipping the first half is why people fight the same infestation for months.
This article contains affiliate links. If you buy through them, we may earn a commission at no extra cost to you. Learn more.
Quick Answer
How do you get rid of pantry moths?
- Empty the cupboard and find the source. Cornell IPM’s first instruction is to remove all product from storage and locate the infestation.
- Throw out anything infested, and freeze what you want to keep. University of Minnesota Extension advises putting infested food in the freezer at 0 degrees F for at least four days to kill eggs and insects.
- Clean the shelf itself. Cornell IPM stresses keeping shelf space free of food debris, since crumbs in a seam feed the next generation.
- Do not spray. Cornell IPM states that pesticide sprays should never be used in the pantry, in cabinets, or around food items.
Bottom line: find the source, freeze or discard, clean thoroughly, then move everything into containers that actually seal.
Why the Moths You See Are Not the Problem
The adult moth does not eat your food. It exists to mate and lay eggs, and the damage is done by the larvae, which is why the webbing, the clumping and the little grubs turn up inside packages while the moths flutter around the room. By the time adults are flying, at least one package has been a nursery for a while.
This is also why swatting moths and hanging a trap feels like progress and changes nothing. Cornell IPM notes that pheromone traps help monitor activity and slow populations by capturing adults, but that they alone will not solve the problem. They are a thermometer, not a cure.
Where the Infestation Usually Started
Almost always in a package that came home already carrying eggs. Flour, cornmeal, oats, rice, birdseed, pet food, dried fruit, nuts and even decorative dried corn are the usual suspects, and cardboard and paper packaging is no obstacle at all to a larva looking for a way in or out.
Step One: Empty and Search
Take everything out. Cornell IPM’s guidance starts with removing all product from storage and locating the source of the infestation, and there is no shortcut, because the one package you leave in place is the one that restarts the cycle. Work through the whole cupboard rather than the shelf where you saw a moth.
Check inside packages, not just outside. Look for fine webbing, grains stuck together, small pale larvae, or a dusty residue at the bottom of a bag. Sealed jars and cans are fine, but check the threads and rims, since larvae will crawl into a screw top and pupate there.
What Gets Discarded and What Can Be Saved
Anything with visible webbing, larvae or clumping goes out, and it goes out to an outdoor bin rather than the kitchen trash. Food that looks clean but sat next to an infested package is worth freezing rather than trusting, because eggs are not something you can see.
Step Two: Freeze What You Keep
Freezing is the standard treatment for dry goods you do not want to throw away. University of Minnesota Extension advises putting infested food products in the freezer at 0 degrees F for at least four days, which kills eggs and insects, and Utah State University Extension gives 0 degrees F or lower for four to seven days to ensure the food freezes all the way through.
Give the freezer a fair chance to do the job. A large sealed bucket in a domestic freezer takes a long time to reach temperature at the center, so break bulk down into smaller bags first. When the time is up, let the food come back to room temperature before opening the bag, so condensation forms on the outside of the bag rather than in the flour.
Step Three: Clean the Shelf Properly
Vacuum first, with the crevice tool, along every shelf edge, every corner and every screw hole in the shelf brackets. Larvae leave the food to pupate and they head for exactly those seams, so a shelf that looks clean can still be holding the next generation.
Then wash with hot soapy water and dry thoroughly. Cornell IPM’s advice is to keep shelf space clean and free of any food debris, which is the whole point of this step: crumbs in a corner are a food supply. Empty the vacuum outside afterwards rather than leaving the bag in the house.
Do Not Reach for a Spray
Cornell IPM is unambiguous that pesticide sprays should never be used in the pantry, in cabinets, or around food items. Beyond the obvious problem of chemicals near food, spraying does nothing about the larvae inside a sealed package, which is where the infestation actually lives.
Step Four: Containers That Actually Seal
This is the step that stops it happening again. Cornell IPM’s storage advice is to transfer dry foods into airtight containers rather than keeping them in original packaging, and the reason is simple: cardboard, paper and thin film are not barriers to a pantry moth larva in either direction.
Transfer on the day you buy, not the day you notice a problem. A bag of flour tipped into a sealed canister within an hour of coming home cannot infest anything else even if it arrived with eggs in it, and that containment is what keeps a single bad package from becoming a cupboard wide event.
Canisters for the Working Pantry
Stackable containers with a gasketed lid are the practical answer for flour, sugar, rice, pasta and cereal you use weekly. Look for a real gasket and a latch or screw closure rather than a lid that just rests in place, and prefer shapes that stack, since a full cupboard is what pushes people back to leaving bags open.
Glass for the Things That Attract Them Most
Flour, cornmeal, oats and nuts are the packages that get hit, and glass jars with a gasket lid are impossible for a larva to chew through. Glass also lets you spot webbing immediately instead of discovering it when you next bake.
Traps as Monitoring, Not Treatment
Pheromone traps catch adult males and tell you whether the population is still active after a clear out. Cornell IPM frames them as monitoring and population slowing rather than a solution, which is exactly how to use them: put one up after you clean, and treat continued catches as a sign you missed a package.
Bulk Storage Out of Reach
Anything you buy in bulk and keep for months belongs in a sealed mylar bag rather than its original sack. That takes the largest and most attractive package in the house out of the equation entirely, and it solves the oxygen and moisture problems at the same time.
The Clear Out in Order
| Step | What you do | Why | Common miss |
|---|---|---|---|
| Empty and search | Remove everything, inspect inside packages | Cornell IPM starts with locating the source | Only checking the shelf where a moth was seen |
| Discard or freeze | Bin infested food, freeze the rest | UMN Extension gives 0 degrees F for at least four days | Freezing a full bucket that never chills through |
| Clean | Vacuum seams, wash, dry, empty vacuum outside | Larvae pupate in shelf corners and screw holes | Wiping the shelf surface only |
| Contain | Transfer dry goods to sealing containers | Cornell IPM advises airtight containers over original packaging | Leaving the bulk flour sack for later |
The step order comes from the Cornell IPM pantry pest guidance, with the freezing figures as published by University of Minnesota Extension and Utah State University Extension.
Frequently Asked Questions
My pantry keeps attracting moths no matter what I do, what am I missing? Almost always a package you have not opened. Check birdseed, pet food, decorative dried corn, spice jars and anything at the very back, and check the shelf seams and bracket holes where larvae go to pupate. Cornell IPM’s first step is locating the source, and repeated moths mean it is still there.
Do pantry moth traps get rid of them? No. Cornell IPM describes pheromone traps as helping to monitor activity and slow populations by capturing adults, while noting they will not solve the problem alone. Use them to check whether your clear out worked.
Can I still eat flour that had moths in it? Anything with webbing, clumping or visible larvae should be discarded. Food that was merely nearby can be salvaged by freezing, which University of Minnesota Extension gives as 0 degrees F for at least four days to kill eggs and insects.
Should I spray the cupboard? No. Cornell IPM states that pesticide sprays should never be used in the pantry, in cabinets, or around food items, and a spray cannot reach larvae inside a sealed package anyway.
Will airtight containers stop them completely? They stop an infestation spreading, which is the practical win. A container with a real gasket keeps larvae out of clean food and keeps any that arrived in a package from getting anywhere else. Original cardboard and paper packaging offers no resistance at all.
Are pantry moths the same thing as flour weevils? No, weevils are beetles rather than moths, though the storage answer overlaps heavily. Our weevils in flour guide covers the beetle side of the same shelf.
The Bottom Line
Pantry moths are a packaging problem wearing an insect costume. Empty the cupboard and find the infested package, discard what is webbed and freeze what you keep, vacuum and wash the shelf including the seams, and then move every dry good into a container with a genuine seal. Skip the spray entirely. The containers are the part that stops it recurring, so start with the airtight food storage containers guide for the working pantry and the mylar bags guide for anything you buy in bulk.