Hershey's (HSY -0.32%) stock price has fallen a huge 45% or so from its 2023 highs. That has pushed the dividend yield up to a historically high 3.7%. Whether or not you view this as an opportunity to buy the stock will depend on how you think the company will handle the potentially long-term headwinds created by a massive rise in the cost of cocoa, a key ingredient in Hershey's chocolate products.

The case for selling Hershey stock

Given the stock price decline, the sell story for Hershey is the one with the most backing on Wall Street. The sell story is pretty simple. The swift rise in cocoa prices is going to crimp profit margins and leave Hershey with weak results for perhaps years, as the supply/demand dynamics in the cocoa market slowly recover. It isn't an unrealistic take on the situation.

A person pointing to a wristwatch.

Image source: Getty Images.

A big part of the problem with cocoa is fundamental to the industry. There has been chronic underinvestment in the crop, with older trees starting to produce less cocoa. An illness is also affecting crop yields. Adding to the problem has been less-than-desirable weather in recent years. The real solution is to invest in expanding cocoa production, but that will likely require a multiyear effort before there's any hope of a material impact. And complicating all of this is the fact that speculators have jumped into the fray, exacerbating the commodity's price swings.

Although Hershey's hedging efforts have limited the impact of cocoa price volatility so far, those hedges are going to start rolling off. It is highly likely that 2025 is a difficult year for the food company. In fact, the company has already warned that earnings could fall by as much as 36% in 2025. And the trouble could easily linger beyond 2025. If you aren't willing to hold on through what is likely to be a difficult period for the company, you should probably sell Hershey or not buy it.

The case for holding Hershey stock

That said, Hershey isn't exactly new to the commodity cycle. It just happens that cocoa prices are swinging more dramatically this time around. The company is going to use the same tools that it always has to deal with the situation. That means cutting costs and raising prices, which is really what all consumer staples companies do when faced with similar issues. It will take time, but given that chocolate is a relatively low-cost indulgent treat, price hikes will probably be accepted by consumers.

There's a complication here with regard to society-level issues, with people appearing to be shifting toward a healthier diet. But chocolate is a beloved food and has been for a very, very long time. It seems unlikely that this fact will change. Given the huge price decline Hershey has already experienced and the historically high yield, it seems reasonable to assume that most of the damage has already taken place concerning the stock price. Note that the last time the yield was near its current levels was during the Great Recession, when investors were worried that the global economy was going to collapse.

​​HSY Chart

Data by YCharts.

The rise in the price of cocoa seems like something that will pass in time. As does the push toward more health-conscious foods. If you own Hershey it probably doesn't make sense to sell it at this point. And if you dividend reinvest, you are leveraging yourself to a price recovery since you are buying more and more shares at relatively low prices.

The case for buying Hershey stock

If you don't own Hershey, but buy into the hold thesis, you might want to add it to your portfolio. But there's one key issue that many investors don't know that may push you over the edge. The Hershey Trust, a philanthropic entity, effectively controls Hershey the company. This is more important than you may think.

The Hershey Trust uses the dividends it collects to fund its giving. So the Trust has a vested interest in ensuring that Hershey the company continues to operate in a reasonable manner and that it grows its dividend reliably over time. So the most important shareholder at Hershey wants the company to be a conservatively run, slow and steady grower. Which is pretty much in line with what most investors will probably want, too.

The biggest benefit, however, is that Hershey is more beholden to its most important shareholder than it is to the broader Wall Street community. So long as The Hershey Trust is willing to give management time to deal with the current problems, which history suggests it will, there's no rush to fix things. Hershey can make appropriate long-term decisions and not the most expedient ones that might hurt long-term performance, which would probably be favored by perennially short-term-focused Wall Street.

In other words, Hershey has plenty of time to work through the cocoa issue and any other issues it may face. If you can see the benefit of that for the company's long-term future, buying Hershey while it has a historically high yield will make a lot of sense.

A lot of moving parts are in play here

Hershey won't be a good fit for every investor, but then no stock is. The near-term headwinds are real and will pressure earnings in 2025, if not longer. However, if you can see the long-term benefit of having a large, supportive shareholder and recognize that the problems Hershey faces are likely to abate at some point, this iconic confections company could be a solid addition to your portfolio. Just be sure you go in recognizing that you are making a long-term commitment and that the news might remain troubling for a little while longer.