WordPress Dashboard Shows 0 Posts? Your Site Isn’t Hacked

A few hours back I opened this site and was shocked to see that there were no posts at all. All the blog posts I have written over these years have vanished, they were not present in the homepage and neither they were accessible from the tag, category, author and other archive pages.

At first I thought the problem might be associated with my site’s theme and how the loop is made. So I logged into WordPress, only to discover that all my blog posts were deleted. The “Right now” section under WordPress dashboard showed 0 posts although all the comments were intact. Here is a screenshot

I felt terrible realizing the situation because the database was working fine and its just that all my posts have been deleted from the database. No Posts and pages were present in the Trash folder as well.

My initial reaction was that someone must have hacked into my WordPress administration area and he has deleted all the posts and pages. I quickly checked my WordPress user account and found that the username and passwords were not changed at all. Not to forget the fact that I use the very awesome WordPress Login lockdown plugin, so it was very unlikely that someone secretly logged into my site’s WordPress administration area.

If you ever come across a similar situation on your site, calm down. Your site and My SQL database are just fine and it is possible to restore all the posts within 5 minutes.

Solve WordPress 0 Posts Error

There is a high chance that the wp_posts table of your site’s MY SQL database needs a repair. Login to your web hosting account, go to phpmyadmin and select the MySQL database of your website. Next, select the wp_posts table, scroll down and hit “Repair” at the bottom

lt should take half a minute until the table is repaired. In my case, all the posts and pages were back just after I repaired the wp_posts table. Phew!

I use an automatic database backup plugin which emails me the database backup after every 3 days. So in my case, the last option would have been to restore a previous database backup to my existing WordPress installation. However, I decided to first post my concern at my Facebook profile and see what other bloggers and geeks recommend. Thankfully, I got this suggestion from RajuPP and it worked like a charm.

Lessons learned:

1. Do not panic when your site acts weird. Think and act!
2. Post your concern on your social profiles. There is a chance that someone knows how to fix the problem you are having at the moment.
3. Do not always listen to the tech support guys. They generally offer good advice but are sometimes clueless about the cause of a problem.

1 COMMENT

This was a super helpful post. This is exactly what happened to me and I too thought my site had been hacked. I can’t tell you how much I appreciated this articles because your instructions worked perfectly to solve a serious problem on my site