Chipotle Mexican Grill's (CMG 0.74%) food safety crisis has been over for six months. But you wouldn't know it from the company's sales results. During the recently ended second quarter, Chipotle's comparable restaurant sales plunged 23.6%.

The company can probably blame social media for its slow recovery. The rapid spread of information -- and in some cases, misinformation -- via social media has made Chipotle's late 2015 E. coli outbreak much worse for the company than it otherwise would have been.

E. coli and social media decimate Chipotle's sales

The first E. coli incidents were reported in late October, with other E. coli and norovirus cases traced to Chipotle in November and December. As news about Chipotle's food safety problems spread during late 2015, customer traffic quickly plunged.

Image source: The Motley Fool.

As a result, Chipotle went from posting modest comparable restaurant sales growth in October to a 16% comp decline in November and a 30% comp decline in December. On a monthly basis, comp sales trends bottomed out in January with a stunning 36.4% decline.

Obviously, the E. coli outbreak itself was the primary cause of these sales declines. But social media likely played an important supporting role, as can be seen from a comparison to the 1992-1993 E. coli outbreak linked to Jack in the Box (JACK 0.81%).

Jack in the Box's E. coli outbreak was far worse than Chipotle's. From late 1992 to early 1993, more than 500 people in the western U.S. became infected with E. coli, mainly from eating regular-size hamburgers from Jack in the Box. Four people died. By contrast, Chipotle's E. coli outbreak only affected 60 people, with no fatalities. (There was also a norovirus outbreak linked to Chipotle in December, but that is a much less serious illness.)

Yet despite the severity of Jack in the Box's E. coli outbreak, its comparable restaurant sales fell only 22.2% during the second quarter of fiscal 1993, at the height of the crisis. Furthermore, its sales trend quickly recovered. In Q3 and Q4, Jack in the Box reported comp sales declines of about 9%.

The difference in the impact of these E. coli outbreaks on sales results can probably be traced to social media. Social media increased awareness of Chipotle's food safety problems in the first place, and Chipotle's food safety issues continued to be the butt of jokes on social media long after the initial outbreak.

The recovery has been bumpy

Chipotle has started to regain customers in the six months since the CDC declared that the E. coli outbreak was over. However, the company's management has been frustrated by the slow (and uneven) pace of the recovery. Here, too, social media deserves a lot of the blame.

Chipotle's brand continues to suffer on social media. Image source: The Motley Fool.

For example, Chipotle's comp sales performance improved from down 36.4% in January to down just 22% by mid-March, suggesting that customers were starting to return. But in mid-March, a story quickly spread about several Boston-area Chipotle employees getting sick.

The employees stayed home, following Chipotle's new strict food safety protocols. As a result, no customers became ill. However, while this incident showed that Chipotle's food safety protocols are working, on social media it was frequently portrayed as another sign that it wasn't safe to eat at Chipotle.

As a result, sales slowed again. Indeed, the second quarter's comp sales decline of 23.6% was still below the mid-March sales trend.

Even complete non-events have the potential to scuttle Chipotle's recovery due to the power of social media. Earlier this month, a popular author tweeted that his editor had to go the ER after getting sick from eating at Chipotle. So far, there is little to no evidence that the tainted food actually came from Chipotle, but it wasn't easy for Chipotle to quell the negative rumors.

A comeback will take longer than expected

Last fall, I believed -- based on previous incidents like the Jack in the Box E. coli outbreak -- that Chipotle would recover from this setback relatively quickly. However, it appears that the rise of the internet and social media has made it much harder for restaurant chains to bounce back from food safety problems.

Chipotle is still likely to emerge from its food safety crisis stronger than ever, but it could take several years for that to happen. The lesson for executives in the restaurant industry is clear: The right time to address food safety weaknesses is now. Waiting for food safety lapses to make customers sick is a recipe for disaster.