Campbell Soup Co. said retailers are stocking up on its namesake product and other canned foods in response to the coronavirus epidemic, a boost to the beleaguered food maker’s sales.

The soup giant, which also sells crackers, cookies, nuts and other dry goods, said Wednesday that retailers are also buying more of its less popular items such as SpaghettiOs and Swanson canned chicken. Campbell said it is treating the epidemic as it would a storm or other natural disaster, making sure it has extra ingredients and finished products...