Help, My Blog Posts Have Disappeared!

Have you suddenly discovered that your posts and pages have all disappeared? Your blog theme/template is still there but it’s saying no posts found?

This has happened to four clients in the last week, three on Hostgator and one on another. I know Hostgator are gradually upgrading all their servers and I’ve no idea if this is the cause but wouldn’t be surprised.

The reason (in these cases) has been a crashed wp_posts database table. The error message given (if you get one at all in your theme or admin menu) is often: “wp_posts is marked as crashed and should be repaired”. To fix is pretty simple. Login to your host’s control panel and go to the phpMyAdmin option. This brings up a list of your databases. Select the one you’re using for WordPress to see the WordPress tables in that database. A list like this will appear (the actual number and name of some tables will vary depending on the plugins used):

Corrupted table

(Click to enlarge)

You can see the problem here, wp_posts is labeled as “in use” and is locked. To repair, simply check the box next to wp_posts and select Repair table, as in the image below.



(Click to enlarge)

You should then get a success message and your posts will have reappeared. If not then you may have a bigger problem, but at least you have a recent backup. Right?!