Hi Scarlett - I find the only answer, especially as my food cupboard rarely gets a egular clean-out is to store all dry goods such as flour, rice, pasta, pulses etc in large glass or plastic containers. We tend of keep large stocks of pasta & rice and find the big glass or plastic jars in which confectioners sell wrapped sweets are particularly useful. I've also found that if you store any dry goods in food cupboards which are above or adjacent to your gas your electric hob, some of the cooking steam invariably seeps into the cupboard and creates a temporarily damp environment in which both beetles and mould can thrive, so if you can rearrange where your store these products in your kitchen this will also help keep them untainted.