When will they learn? It seems a month doesn't go by these days where a company doesn't get itself into trouble by trying to be hip using social media to market itself, only to end up getting burned instead.

The latest corporate social-media marketing snafu was launched by cereal maker Kellogg (K -0.51%), which had the virtuous-sounding idea to donate 2 million breakfasts to hungry children -- except it also decided to try to get something out of it for itself. Its U.K. division sent out a tweet saying, "1 RT=1 breakfast for a vulnerable child," making it sound more like it was holding breakfast hostage in return for brand promotion. (For the uninitiated, "RT" means "retweet.") 

The backlash was immediate as the Twitterverse lit up with condemnation. While the tweet was quickly removed and an apology followed -- and a second one again later that night -- it was a mealy-mouthed mea culpa that didn't go over well with Twitterers.  

As Twitterers noted, it wasn't simply bad grammar or "wrong words" that caused the brouhaha, it was the fact that this was the company's social marketing plan at all that was offensive. Companies can be philanthropic without always having to also gain in the transaction.

That's what happened to Barilla pasta when its chairman said he'd never feature homosexual families in the company's ads and if they didn't like it they could eat another brand of pasta. When the condemnation rained down on the company, he apologized for creating a "misunderstanding." No, it was clear everyone understood exactly what was said -- and didn't like it.

Coca-Cola also came in for its fair share of criticism when it launched a promotion that paired one English word with a French word as a means of symbolizing the beverage maker's products in Canada. Problem was, a girl with a severely developmentally disabled sister had the misfortune of getting a bottle cap that read "You Retard." While the offensive word does have several meanings in both English and French, it was enough of an embarrassment that Coke canceled the whole campaign.

From oil giant BP, whose then-CEO complained about wanting to "get his life back" at the height of the Gulf of Mexico oil spill as thousands of fisherman were losing their livelihoods, to Abercrombie & Fitch's CEO, who said he didn't want fat or ugly people shopping in his stores, only to have to come begging now to the less-than-beautiful people for sales as his store's style falls out of fashion favor, executives would do well to fully think through both what they're saying and the image their company is projecting.

Taking up the mantle of being social-media savvy isn't bad, but it must be done with care. PepsiCo had a "Dub the Dew" campaign to come up with a name for its new green-apple-flavored drink, only to have it blow up as less than savory names got top honors. Wal-Mart had its rap-star spokesman Pitbull sent to some desolate Alaskan store after it was chosen on Facebook as the next destination on his tour.

As long as companies insist on using social media to advance their own corporate agendas, we're going to continue seeing such mishaps, though they do seem to happen with more regularity these days.

Although Kellogg's campaign goal is a worthy one, and it has pledged to donate 1 billion servings of cereal and snacks in its support of global hunger relief by the end of 2016 -- though a "serving" equates to one ounce, which is a pretty sparse meal, to be sure -- it needs to show it's doing the campaign for the right reasons.

Over the past five years, Kellogg has donated $68 million in cash and $129 million in products to charitable organizations across the world. Let's just hope they continue doing that good work without trying to gain any greater leverage from the offer.