If properly processed and sealed, canned food will remain safe for many years.
How long can canned food be kept and still be absolutely safe to eat?
If properly processed and sealed, canned food will remain safe for many years (though I wouldn't make use of the jars abandoned in Grandma's cellar). If it hasn't been properly processed and sealed when home canning, it will have spoiled.
Canned Food Safety Tips
Here are some typical signs to look for when it comes to home canning:
Unopened containers: cans that seep or bulge; leaky seals; moldy seals or food; cloudy or yeasty liquid; food that's shriveled, spongy-looking, or unnaturally colored (often dark).
Opened containers: spurts when opened; fermentation; soft or slimy food; unpleasant odor; moldy lid.
But, even though older canned goods may be safe to eat, most will undergo some deterioration in nutrition or quality (color, texture, flavor) after about one year. I've personally had fruits, sauerkraut, and beans darken and soften. My tomatoes, pickles, and jellies have held up better, though they may have lost nutrients.
Storage in a cool, dark, dry place will prolong the time canned food will retain its optimal condition.
— Susan Ervin, long-time organic gardener and former agricultural researcher