Consumer Reports has no financial relationship with any advertisers on this site.

Nobody wants to throw out good food, or eat food that has gone bad. It’s a balancing act, and most of us are erring on the side of too much waste.

“We’ve all been there — your favorite brand of pasta is on sale and you buy too much,” says Amy Keating, a nutritionist at Consumer Reports. “Or you think you’ll be making dinner every night during the week, but then things come up and the food goes bad before you’ve had a chance to use it.”

Fortunately, you can make sure your food stays good longer — even fresh foods such as vegetables and eggs.

Basic guidelines

The first rule of keeping food fresh is to check the temperature in the places where you store it. Kitchen cabinets should be between 50 and 70 degrees, says Jackie E. Ogden, family and consumer sciences agent at the University of Georgia Extension and president of the American Association of Family & Consumer Sciences (AAFCS). Set the fridge to 37 degrees and the freezer to zero or below.

Next, don’t take those “best by” dates on packages as gospel — even for fresh foods such as yogurt, milk or eggs. “It’s easy to interpret them as ‘throw out on this date’ when what they may really mean is ‘this food may taste best before this date, give or take,’” Keating says. “But when in doubt, throw it out.”

And when you’re storing dry goods, the key word to remember is airtight, says Nancy Bock, senior director of communications and marketing at AAFCS. That helps to keep bacteria and moisture out.

Finally, be sure to label containers and bags with the date you wrapped and refrigerated or froze them.

Stay-fresh tips

Bananas: Once the fruits reach the level of ripeness you prefer, put them in the fridge. They’ll continue to ripen, more slowly. The peels will darken, but that doesn’t affect the fruit inside. If you end up with overripe bananas, peel and wrap them tightly and store in the freezer to use for baking or in smoothies.

Bread: Never refrigerate bread or baked goods such as bagels, according to the National Wheat Foundation. These products can go stale up to six times faster than if you stored them in a breadbox, a kitchen cabinet or somewhere else dark and cool. For longer storage, you can freeze bread whole or sliced. Wrap it tightly in foil or plastic wrap and put it in a sealed container (such as a zip-top plastic bag) and it will keep for three months.

Broth, non-cream soup or pasta sauce: When you’ve only used half the box, jar or can, it doesn’t have to just sit in your refrigerator until it goes bad. Transfer the remainder to an airtight freezer container, leaving extra space at the top for expansion, and freeze it.

Butter: Butter is surprisingly hardy for a dairy product. In the fridge, it lasts one to two months. But it can also be stored, tightly wrapped in an airtight container in the freezer, for six to nine months.

Cheese: Hard (cheddar, Swiss) or soft (brie, Bel Paese), cheeses can be frozen for up to six months. The caveat? The texture will become more crumbly, so it’s best to plan to use it for cooking, not snacking. Hard cheeses probably will fare better, but they last up to six months in the fridge, anyway. (Soft cheeses should be eaten within one to two weeks.) Shredded cheese lasts for one month when refrigerated, but you can extend that to three to four months by freezing it.

Eggs: If you’re planning to eat or cook with them within three to five weeks after purchase, the fridge is generally fine. But if you’re not going to finish your carton in time, eggs can be frozen for later use in cooking and will be good in the freezer for about a year.

Crack and lightly beat whole eggs before freezing them in tightly sealed freezer containers. Egg whites can be frozen without beating. Egg yolks alone need special treatment before freezing to make sure they’re usable when they thaw. If you’re planning on using them in something sweet, beat in 1½ teaspoons of sugar for every 4 yolks before freezing; if you’re going to make something savory, beat in ⅛ teaspoon of salt for every 4 yolks before freezing.

Flour: Not only can refrigeration and tight wrapping keep your flour bug-free, it can extend all-purpose or bread flour’s usable life to two years. For those who don’t use flour often, it may be more practical to store it in the freezer, where it will keep indefinitely.

Note that whole-grain flour degrades more quickly because of the oils in the grain’s germ. In a cool, dry place, it can keep from one to three months; freezing can double that.

Greens: There’s not a lot you can do to extend the refrigerator life of, say, lettuce, beyond keeping it wrapped in the crisper drawer, where it can keep for up to a week, Ogden says. Spinach, however, can last 10 months when frozen. “You blanch it — plunge it into boiling water — to stop the enzymes that break it down, then cool it quickly to stop the cooking process, dry it thoroughly and then freeze it in an airtight container,” she says. Blanching and freezing will work for broccoli, cauliflower, corn kernels or okra.

Herbs: Parsley, sage, rosemary, thyme, basil and other fresh herbs have very limited shelf lives. You can puree fresh basil, cilantro, parsley or oregano with a little olive oil and then freeze the puree in an ice cube tray. Pop the cubes into a plastic freezer bag and use them to season pasta or soup or to top chicken or fish.

Milk: Depending on how it has been transported and stored, a carton of pasteurized milk may or may not be okay a few days past the date on the label — a sniff will probably tell you. But if you freeze it, the milk will be usable for up to three months, Ogden says. “It may not have the same texture,” she says, “so you may want to use it for cooking rather than drinking.”

Pasta: Dried pasta in an unopened package can be stored and used up to two years, even past its “best by” date, but refrigeration won’t extend its usable life. If the package has been opened, it’s good for up to one year. (Just one to three months for egg noodles.) Fresh pasta, however, lasts just four to five days in the fridge, but up to six to eight months in the freezer.

Strawberries: Prevent berries from going moldy quickly by removing the stems and placing them in a paper towel-lined container. Refrigerate and don’t wash the berries until you’re ready to use them.

Whole grains: These healthy grains, such as wheat berries, don’t keep as well as less-healthy refined grains, largely because of the oils in the grain’s germ. In an airtight container in a cool, dry place, whole grains will generally keep for about six months. Keeping them in the freezer can double that. You can also freeze grains that you have already cooked.

For more guidance on how to safely handle and store foods, and specific storage timelines for a range of foods, you can turn to the Agriculture Department’s free FoodKeeper app.

 Copyright 2020, Consumer Reports Inc.

Consumer Reports is an independent, nonprofit organization that works side by side with consumers to create a fairer, safer, and healthier world. CR does not endorse products or services, and does not accept advertising. Read more at ConsumerReports.org.