How about this, you wake up one morning, you get your cup of coffee like you usually do, you open the web browser and to check how your site is doing only to find out that all your posts, pages, comments, all your hard work have vanished, but with the website still working. The first thing it will come to mind is “did anybody got into my site and deleted everything?”, “did a malware did this?”. I could be, but not today.
If this is something that happened to you, be calm, it is just a problem in your WordPress database. The first thing you should do is to sign in to your host provider (e.g., Godaddy, Bluehost, Host Gator, etc.) and get access to the phpMyAdmin panel.
Open your site database, and you will discover that the wp_posts table (here is where WordPress all posts and pages content) now displays a messages that says: “in use”. There could be a bunch of reasons to why this occurred. I could be a bad plugin, perhaps and more likely a problem with your WordPress hosting server.
I know that you are here for a solution, so here we go: While logged in to the phpMyAmdin and in your site database, select wp_posts table by clicking the box selector and at the bottom of the database, you’ll find a drop-down menu, there simply select Repair table. Wait and you should see a green message that says “Your SQL query has been executed successfully”. If you see this message, you are all set.
That’s all there is to it. Now go back to your website and refresh, it should be working now.