We’ve just seen two spectacular stories of how employee dismissals can go dramatically awry in the era of social media.

First, Applebee’s waitress Chelsea Welch was fired for posting a photo on Reddit that showed a customer receipt inscribed with a anti-tipping (but pro-religion) message: “I give God 10%. Why do you get 18?” Between the original Reddit post, Welch’s subsequent article for The Guardian, and a flurry of on- and offline coverage, Applebee’s found itself at the center of a firestorm that gave everyone from labor organizers to social media evangelists something to fret about.

The very next day, we were treated to a first-person account of a mass HMV layoff, as the company’s Online Marketing and Social Media Planner live tweeted her own firing… from the company’s own Twitter account. While it only took 20 minutes for a senior manager to realize what was happening and shut off the tweets, that was long enough to garner HMV global headlines for its lack of foresight.

While one might reasonably debate who was at fault in each of these cases, it’s hard to argue that either situation was good news for the employer. Not only did the companies face tough questions about their termination decisions; they were called out for creating a “a mini-PR disaster” (in the case of HMV) and a “PR nightmare” in the case of Applebee’s.

Welcome to the challenges of HR in the social media age. It’s no longer enough to pile your freshly-dismissed employees’ belongings into a banker’s box and march them out of the building; you’d have to banish their phones and jam their Wi-Fi access if you want to guarantee that their stories will stay offline.

Since that’s neither a viable nor desirable solution, it’s time to face up to the new reality: by potentially exposing any dismissal to public scrutiny, social media makes your customers and the public into de facto stakeholders in your internal HR policies and processes.

That means that companies need to consider both their HR policies and their social media policies in light of the very real possibility that any termination or workplace dispute may become very public very fast. This is doubly true in the case of any dismissal that’s occasioned by a social media misstep, or that involves an employee with a significant social media presence.

But there’s no changing a hard truth about business: sometimes, you have to let people go. Here are five ways you can social-proof your company against backlash from dismissals or disputes:

1. Even if you have a large team working on your social media presence, consolidate management of your social media accounts so that as few people as possible hold the password for your public presences. Use a social media management tool that provides gated access to your social media accounts, so that you can cut off any one employee’s access to all your social accounts by severing their access to your system. Make sure that any social media account passwords are held by at least two people (and recorded in a secure company database), and that they are tied to a corporate (rather than personal or independent) email account, so that in a worst-case scenario, your IT department can get access to all passwords.

2. Set explicit policies for which kinds of online violations are grounds for termination, and be sure that your employees are actually acquainted with these policies. Do note that the legal and regulatory landscape around corporate social media policies is evolving fast, so you will need to consider not only what kinds of policies you’d like, but which policies are likely to be upheld if you face legal action. Just as important, consider which policies might be deemed reasonable by your customers or the general public, in the event that a dismissal became an online cause célèbre.

3. Treat the dismissal of any employee with a significant social media following the way you would treat the dismissal of a senior executive: as an internal matter for which you need an external communications plan. No, you don’t need to convene the board or draft a 12-point game plan every time you lay off an employee with more than 25 Twitter followers. But you should have a generic communications plan that you have on standby in case any layoff gets social media coverage, as well as a protocol for identifying, escalating and addressing any HR story that gathers momentum online.

4. Make sure your social media monitoring covers HR keywords. Particularly if you have a band with a higher volume of social media mentions than you can completely review, set up and monitor searches on your company name plus keywords like “hired”, “fired”, “interviewed,” or “layoff”. Tracking these mentions constantly and thoroughly will not only ensure you notice when a departing employee turns into an issue; it can help you identify those would-be employees who post ill-advised tweets on their way out of the interview.

5. Manage your GlassDoor reputation as carefully as your Yelp profile. Lots of companies put a lot of attention into their customer-facing social media presences, but pay little or not attention to employee- or recruit-facing sites. But reviews on GlassDoor, which claims to offer a peek inside companies’ walls and compensation, can influence would-be applicants and even third party observers. Keep an eye on what your current and past employees say about you on these sites, not only as an early warning system for your PR team, but as an even more crucial source of intelligence on employee satisfaction.

There’s no set of policies or practices that make employee dismissals into happy occasions. But with the right protocols in place, you can avoid being the next HMV or Applebee’s. That means not only averting PR disasters, but helping employees make smart choices about using social media so that they can stay on the team — and by becoming the kind of tuned-in, engaged employer they want to keep working for.