Shelled walnuts stay fresh in the pantry for about 12 months. Of course, it's not that after that period all nuts are discarded. But chances are that at least some of them are dry or stale, and some of them are stale. If the walnuts look good, smell them.
If they still have that fantastic nutty smell, they're still fresh. However, if they smell a little sour, like paint thinner, it's best to avoid eating it. Walnuts have a fair shelf life, which lasts up to 3 months with the shells set at room temperature. When the shells are removed, the nuts oxidize much faster and only stay fresh for a couple of weeks.
However, nuts will not spoil if they are not opened. If stored in the refrigerator, they will stay cool for about nine months; if stored at room temperature, they will stay cool for about six months. Once opened and exposed to air, walnuts are best consumed within 7 to 10 days for maximum freshness. Once you open the bag, transfer the nuts to an airtight container to maintain freshness and place them back in the refrigerator or freezer.
A healthy shelled nut weighs when you pick it up, and when you shake it, you can't hear the movement of the grain inside the nut. However, it is not recommended to eat nuts that have passed their prime because they can cause gastrointestinal upset. Walnuts last 1 to 2 years in the freezer, although it is best to use them within a year (and three months if frozen raw). Nuts are a healthy snack, but it's important to keep them fresh to keep them from losing their flavor and going rancid.
In case you want to protect shelled walnuts from going rancid, there is no need to refrigerate them. However, when a nut goes stale, it will feel light when you shake it and you can hear the grain moving around the shell. If it shows any of these signs, you can open it to double check, but chances are your nuts have gone stale. For shelled walnuts, refrigeration is what I recommend, especially if you need them to last longer than a couple of months.
There are several different ways that nuts can go bad, some of which are obvious and some of which are not. If you have chopped or ground nuts and want to know if they are still fresh, sift the walnuts. But sometimes you may find that they are too bitter for your palate and you start to wonder if the nuts spoil. The best preventive measures are the nut shell itself, a sealed container, darkness and stable cold temperatures.
An exception is vacuum-sealed black walnuts, which can keep their flavor and nutrients intact for up to a year if stored at room temperature.