When Unsure of Quality
The common phrase "When in doubt, throw it out" is relevant in most cases when dealing with food. For pantry items such as sugar, flour and baking cocoa, if an item has a strange smell or discoloration, or if you are unsure of its age, it is wisest to throw it away.
Unopened Packages Are Okay
For an unopened package of baking cocoa, there is no time limit. For a package that has been opened, expect to be able to keep it in your pantry for one year. According to Julie Garden-Robinson, a food and nutrition specialist at North Dakota University, it is still safe to eat baking cocoa after one year, but the quality greatly diminishes.
Assuming the baking cocoa appears and smells fresh, it will remain so for about one year after opening. Unopened containers can be kept indefinitely.