Clorox (CLX -0.69%) is best known for its iconic bleach brand, but it produces much more than that. Coming out of the pandemic, the consumer staples company's margins collapsed in the face of a rapid surge in inflation. The stock fell sharply and I bought shares, expecting that the recovery plan which management laid out would be executed well.

And now the consumer products powerhouse has suffered another blow: a data breach, which has led to another stock drop. Already a shareholder, I bought more as soon as I could since I believe this is an opportunity. Here's why.

Clorox is more than bleach

Clorox is a broadly diversified consumer staples company with a focus on manufacturing products that have little direct competition. Often the only significant competitive threat comes from store brands. That's basically the case in bleach, which is the company's eponymous product, but also in trash bags (Glad) and charcoal (Kingsford). And it owns other brands as well.

A person cleaning a counter in their home kitchen.

Image source: Getty Images.

For example, Clorox owns Burt's Bees, Fresh Step, Hidden Valley, and Brita, along with an extensive list of branded cleaning products. There is a lot going on here and Clorox is probably best thought of as a brand management company. On that front, it has a long history of successful innovation behind it.

Most recently that's included "crossover" efforts like infusing Glad trash bags with its cleaning products' scents. Or a continuous spray bottle in the Clorox line meant for surface disinfecting. Or a new version of Fresh Step called Outstretch that allows cat owners to change the litter box less frequently. When it comes to consumer staples, the words "new" and "improved" are huge customer draws.

But the company's overall strength is probably made most evident by the fact that it has been able to increase its dividend annually for 46 consecutive years -- or just four years shy of Dividend King status. You don't create a record like that by accident. The dividend yield today is around 4.1%, which happens to be near the highest levels in Clorox's history.

CLX Chart

CLX data by YCharts

What's gone wrong at Clorox?

You don't have to look closely at the chart above to see that there's a shocking yield spike toward the end, accompanied by a steep price plunge. The dividend yield and share price move in opposite directions, so that's exactly what you would expect to see. The main reason for the decline was a huge drop-off in the company's profit margins coming out of the coronavirus pandemic. There were two issues that caused this to happen.

First, Clorox benefited from a spike in demand as people bought more cleaning supplies during the pandemic. In order to keep up with demand, management hired contract manufacturers, which is more costly than producing in-house. When demand cooled off, as the company expected, it was left with higher costs right as a second hit came along in the form of inflation. Clorox's margins were crushed and investors bailed on the stock.

CLX Gross Profit Margin Chart

CLX Gross Profit Margin data by YCharts

Management outlined a plan to cut costs, raise prices, and improve margins. The first order of business was exiting the relationships with temporary contract manufacturers. But the rest of the recovery process was expected to be slower, with Clorox targeting a multi-year uptrend. It was living up to that plan, with margins recovering fairly steadily.

And then there was a cyberattack in August. It was bad, too, hurting sales as it temporarily forced employees to effectively use pen and paper when fulfilling orders. The stock plunged and I jumped in because I wanted to buy more shares before it was too late.

The company pre-announced fiscal first-quarter 2024 earnings because there was going to be an ugly hit to its financial results. I believed, and still do, that the impact will be short-lived and that Clorox will get back on the margin recovery track. When it officially reported Q1 results, they ended up being better than what Wall Street had expected. The stock rallied on the news, but the shares are still attractively priced. I might even step in and buy some more.

Executing well in the face of adversity

Clorox has taken yet another punch to the gut, but its earnings beat suggests that management is coping reasonably well. I believe that the latest hit is a setback, not a knockout blow. But investors are still in a "show me" state of mind. That's fine by me because it means there's more time to buy the shares at what appears to be an attractive price point, using the dividend yield as a rough gauge of valuation. You just need to brace yourself and take the leap of faith that Clorox will get back on the recovery path it was already treading.