Something positive almost always comes out of a negative situation.
In my case, it happened earlier this week while I was continuing work on my WordPress plugin. After adding a single page when testing, I wanted to delete it. Rather than delete the single post, I accidentally clicked the “select all” button on the first page of posts, then clicked through the Yes/No prompt. Immediately after pressing it, I realized what I had done and madly tried canceling the operation. Thanks to MySQL’s lightning fast response time, my last 12 posts were long gone by the time I could do anything about it. After being unable to access my webhost’s backup files, I set about the task of recreating my posts out of the Google cache. They are now fully repaired, which is why you won’t notice a real difference.
What did I learn from this?
Make sure your posts are in the Google index
If your site is indexed often, and correctly, by Google’s robots, you’ve already got a last-ditch backup system in place. While recreating posts from this information is rather time consuming, it is certainly better than losing everything.
Use automated backups
Thankfully, WordPress’ dependence on MySQL databases means there are plenty of plugins available to make backup painless. After some reading, I found a plugin called WP-DB-Backup that can backup your entire database and either download it to your computer, save to your server, or automatically email to an account of your choice. I’ve set up a 7GB Gmail account that will now contain daily backups of my WP database.
Check your webhost backups
Every webhost backs up their client’s data. A good website administrator checks the backups to make sure they work properly. When something goes wrong, a good backup can get your site back online immediately, but if you can’t use it, you’re stuck.
So after somewhat of an anxious few hours, I’ve seen the error of my ways, and now have a safety net in place. Here’s hoping you’ve done the same.