(CNN) -- Do you know what's in your cupboards and freezer -- and how long it's been there? While flours, grains, oils, and frozen foods have a longer shelf life than most of what's in your fridge, they do eventually go stale. Follow our test kitchen's guide to whipping your pantry into shape.
Martha Stewart Living: 15 kitchen shortcuts that will change the way you cook
Keep your spices in airtight jars. Stored well, spices will last up to one year before they begin to lose their aroma.
Get the clip art labels for organizing your spice cabinet.
Martha Stewart Living: Quick, one-pot meal ideas to feed the whole family
If you go through a lot of all-purpose flour in your household, you can keep it at room temperature in an airtight container for up to three months.
Whole-grain flours (wheat, rye, buckwheat, spelt) contain the oil-rich germ of the grain, which can quickly turn rancid. These flours, as well as any others you don't use on a regular basis (pastry flour and semolina, for example) can be kept in the refrigerator for up to six months. Slip the original bag of flour inside a zip-top bag for easy, moisture-proof storage.
Martha Stewart Living: 34 reasons to eat a burger every day
Rice and Grains
Keep oats, barley, rice, quinoa, and their kin in airtight containers in your cupboard for up to six months.
A Good Thing for Pantry Organizing: When transferring dry ingredients to glass jars, use an envelope if you don't have a small funnel nearby. Cut a generous triangle from one end of the envelope, then snip tip off corner, and open into a cone. For large amounts, use big manila envelopes.
Martha Stewart Living: Easy, everyday meatless recipes
Nuts and Seeds
Because nuts and seeds have a high fat content, they'll turn rancid if kept at room temperature for too long. Your almonds, walnuts, pecans, pistachios, cashews, macadamias, pepitas, sesame seeds, and flax seeds will stay fresh for up to two months in the refrigerator and as long as 12 months in the freezer.
Martha Stewart Living: 35 beyond delicious no-bake dessert recipes
Your most frequently used oils -- olive and vegetable -- can be kept in a cupboard at room temperature for two months once opened, so don't buy a bigger bottle than you think you'll use in that amount of time. (A gallon of olive oil is no bargain once it goes bad!) Nut oils, and other varieties you use less frequently should go straight into the refrigerator once opened. Kept cold, your oils will be good for at least six months.
Martha Stewart Living: Hands down, the 20 grilling recipes you must try this summer In the Freezer
In our test kitchen, all meat gets wrapped in butcher paper, followed by a layer of plastic wrap, and another of foil to protect it from freezer burn. Use it up within two months.
Fruits, vegetables, soups, and stocks also should be protected against freezer burn by sealing them tightly in a zip-top plastic bag or airtight container and used within about two months.