1. Empty the cupboard completely and sort as you go
Everything comes out. Not a shelf at a time — everything, onto a cleared counter or the kitchen table. Partial resets always leave the back corner untouched, and the back corner is the problem.
As each item comes out, put it into one of four groups. Keep, for things you use and that are in date. Eat soon, for anything close to its date or already opened. Donate, for unopened items in date that you know you will not use — food banks take tinned and dry goods gratefully. Bin, for anything opened long ago, infested, or genuinely past a use-by date.
Be honest in the third group. The speciality vinegar bought for one recipe in 2024, the four tins of chickpeas nobody in the house eats, the novelty popcorn kernels: these are the items that take up prime space and make everything else harder to see. Their cost is already spent whether you keep them or not.
Check for pantry moths while the shelves are bare. Fine webbing in the corner of a flour bag, small grubs in the lid threads of a jar, or a run of tiny moths when you open the door means you have them. Bin the affected packets in an outside bin, wipe every shelf and the cracks with hot soapy water followed by vinegar, and from then on keep flour, rice, nuts, cereal and dried fruit in sealed containers — the single most effective prevention there is.
Wipe the shelves and let them dry fully before anything goes back.