Many pantry items, like white rice and dry pasta, are shelf-stable and safe to eat for years. Other items can lose their flavor or nutritional value over time, and some can become unsafe after they expire.
Thai Liang Lim / Getty Images
Discard: 12 months from date of purchase if unopened, 3 to 5 months after opening
Most cooking oils, such as vegetable, canola, and olive oil, stay fresh in your pantry for about 6 to 12 months from the date of purchase and 3 to 5 months after opening if stored properly. Some oils, like coconut oil, can stay fresh for up to three years.
Over time, exposure to light, heat, and air can break down the fats in cooking oil, leading to rancidity. Rancid oil has a sharp, unpleasant smell and taste and loses some of its healthy fats and antioxidants.
Expired or rancid oils also generate harmful free radicals that can damage your cells, cause inflammation, and increase the risk of chronic conditions, such as heart disease and cancer.
Daniel Tamas Mehes / Getty Images
Discard: After 6 to 9 months unopened, 2 to 3 months after opening
Nut butters, including peanut, almond, and cashew, can last 6 to 9 months in the pantry when unopened. Once you open the jar, it stays fresh for about two to three months in the pantry.
Nut butters contain oils that can spoil when exposed to oxygen (oxidation), altering their flavor and texture. It might not make you sick, but it can contribute to inflammation, damage cells, and increase the risk of heart disease and cancer over time.
Nut butters kept past their expiration date or stored in the pantry for too long can also harbor harmful bacteria, such as Salmonella, and cause foodborne illness. Toss nut butter if you see mold, if it has a paint, cardboard-like, or chemical smell.
Panagiotis Kyriakos / Getty Images
Discard: 1 year for all-purpose white flour, six months for whole-grain flour
The shelf life of flour depends on how it is processed and stored. When kept in an airtight container in a cool, dry pantry, all-purpose white flour can last up to one year. Whole-grain flours, such as whole wheat, last only up to six months because they contain the grain’s germ, which is rich in healthy fats that spoil more quickly.
Over time, exposure to oxygen causes these fats to turn rancid, giving the flour a sour smell and bitter taste. Moisture can also pose a risk. Damp flour may allow certain molds to grow, producing mycotoxins that can cause serious illness.
Older flour can attract pantry pests, such as small beetles, making it unsafe to use.
faithiecannoise / Getty Images
Discard: 3 to 4 years for whole spices, 2 to 3 years for ground spices, 1 to 3 years for dried herbs
Most whole spices stay fresh for about three to four years. Ground spices stay fresh for two to three years. Dried herbs usually lose their potency after one to three years.
Some spices and herbs contain antioxidants and other beneficial compounds that can degrade as products age, so expired spices may lose their flavor and offer fewer potential health benefits.
Once opened, ground spices and herbs can absorb moisture from the air, creating a favorable environment for mold and bacteria to grow. Consuming moldy spices can trigger allergic reactions and respiratory problems in some people.
Toss and replace spices if they look clumpy, faded, or have lost their smell.
Discard: 1 year
Dried beans and lentils can be stored in the pantry for up to one year when kept in food-grade packaging or until their expiration date. They may remain edible, but their nutritional value gradually declines. After 2 to 3 years, vitamin levels begin to drop, and by around five years, they contain little to no remaining vitamin content.
Beans stored for longer than a year may also become difficult to rehydrate. As beans age, their cell walls thicken and absorb less water during soaking or cooking. This can prevent them from softening, making them harder to digest and more likely to cause stomach discomfort or digestive issues.
Proper storage extends the shelf life of pantry items and helps you keep them organized and fresh. Here’s how to keep your pantry staples fresh and safe:
- Use airtight containers. Store dry goods in sealed, airtight containers in cool, dark places. Keep them away from heat sources, such as the oven, and from areas with high humidity.
- Label your food. Write the purchase date, expiration date, or the opening date on every container to help you track exactly how long an item has been on the shelf.
- Rotate your stock. Keep your pantry organized so older items move to the front. Using older items first can help reduce waste.
- Inspect items regularly. Check your stored foods for signs of pests, moisture damage, or spoilage. Keeping a clean and dry pantry is a great way to prevent foodborne illness.

