Here's how long you can keep flour, sugar, rice, nuts, oil and other pantry foods

Have you been hanging on to a bag of old flour in the back of your pantry for a really long time? Do you even remember when you bought it? If you answered yes then no, this pantry essentials checklist is for you.

Before you get halfway through making a pie crust on Thanksgiving Day and find weevils in your trusty old bag of flour, you might want to consider checking the quality of some of the pantry items we buy in large quantities (like sugar, flour, baking soda, dry pasta and canned goods). Sometimes the things with the longest shelf lives are the most likely to be forgotten and overstay their welcome.

Here’s a list of shelf lives for common pantry staples and storage tips to get the longest use out of them.

Pantry a mess? Here are 5 simple pantry organization ideas.

What items should always be in your pantry?

Here are some pantry staples that every well-stocked home cook keeps in their cupboard, according to “Martha Stewart’s Homekeeping Handbook

  • Canned and bottled items: canned plum tomatoes, tomato paste, green and black olives, olive paste, anchovies, anchovy paste, capers, chickpeas, black beans, hot sauce, mustards, canned tuna, chicken broth, canned fruits, chutney, fruit jam

  • Dried pasta

  • Baking essentials: pure vanilla extract (and other extracts), baking soda, baking powder, unsweetened and semisweet chocolate, cocoa powder, unflavored gelatin, dry yeast, cornstarch

  • Rice, other grains and dry beans: quick-cooking polenta, cornmeal, oats, rice (arborio, long-grain white, medium-to long-grain brown and basmati), lentils, black-eyed peas and split peas, beans (black, pinto and cannellini)

  • Flour

  • Sugars and sweeteners: granulated white, superfine, light brown, dark brown and confectioners' sugar, light corn syrup, molasses, maple syrup, honey

  • Nuts and dried fruit: pecan and walnut halves, pine nuts, peanuts, cashews, almonds, hazelnuts, raisins, dried apricots, dates, figs, sun-dried tomatoes

  • Oils: extra-virgin olive for cooking and for drizzling, canola oil, peanut oil, toasted sesame oil

  • Spices and seasonings

Can you use canned goods that are 2 years old?

According to the U.S. Department of Agriculture, most canned foods are safe indefinitely. Canned goods can stay good for years. It’s okay to eat canned food as long as the can isn’t rusted, dented or swelling.

Martha Stewart suggests using canned or bottled goods within a year of buying them. According to her pantry essentials guide, most canned and bottled goods like preserves, pickles and relishes can be kept unopened for up to a year.

How long can you store dried pasta?

Dry pasta, like canned goods, has a really long shelf life. Most dried pasta has a shelf life of around two years, but you can sometimes stretch that to three, according to Food Network.

How long can you keep baking ingredients?

Vanilla extract has an indefinite shelf life, but its flavor is best within five years. Corn starch also has an indefinite shelf life.

Baking soda and baking powder may seem like they would have a long shelf life, but compared to some of the other things on this list, they need to be replaced frequently. According to the USDA, unopened baking soda can last for up to a year and a half and opened baking soda can last for up to six months stored at room temperature. The shelf life of baking powder is half that. It will stay good for six months unopened and three months opened, if stored at room temperature.

Yeast can be kept for up to two years unopened and will stay good for four months in a refrigerator once it's opened. If kept in the freezer, opened yeast can stay good for up to six months.

Unopened dark chocolate can keep for up to two years from when it was made. Open dark chocolate can stay good for around one year.

How long can you store flour and sugar?

White flour, all-purpose and self-rising flours can stay good for up to six months, if they’re stored in a cool, dark place. Flour kept at room temperature should be thrown away after three months, but you can lengthen its life by storing it in the refrigerator or freezer. In a fridge, flour can stay good for up to a year and in the freezer, it’s good for around two years.

While it’s recommended that you throw away your unused sugar every two years, it has an indefinite shelf life if it’s in an airtight container and stored in a dry place.

Do nuts and dried fruit go bad?

Dried fruit like apricots, prunes and raisins will stay good in the pantry for six months, according to the USDA.

Nuts can go rancid after a few months if they’re stored in a cabinet that’s too moist or warm. If they taste unusually bitter or sour, check the “best by” date. How long nuts last depend on how well they’ve been stored and what kind of nut they are. Shelled nuts can last up to a year.

Do dry grains and beans go bad?

Dry grains, like rice, can stay good on a cool, dry pantry shelf for up to six months and will stay good in the freezer for up to one year.

Dried beans stored on a cool, dry pantry shelf will stay good for a year or more if they’re in a food-grade bag.

How can you tell if cooking oil is bad?

Oil, like nuts, can also go rancid. If your oil smells musty or sour, it’s gone bad. If you properly store your cooking oils in dry, airtight containers in a cool, dark place, some of them can last up to two years.

If you have a huge jug of vegetable oil sitting in the back of your pantry and can’t remember when you bought it, give it a sniff test and buy a smaller size next time.

Can I use expired vinegar?

Vinegar doesn’t really go bad, it just loses its potency if it isn’t stored properly. Vinegar’s expiration date indicates when it will start to lose its acidity. It should be stored the same as oils: in a dark, cool cabinet with the lid tightly sealed.

How long are spices good after the expiration date?

Spices, dried herbs and seasonings also have an indefinite shelf life. When a spice or dried herb goes “bad” it doesn’t mean that it will hurt you to consume it, it just loses its flavor and potency, like vinegar.

This article originally appeared on Florida Today: Here's how to keep flour, pasta nuts and other pantry staples fresh