WordPress Back To Default Install State – wp_options Table Corrupted
If you read my blog every day or so you may have noticed a couple of times in the past week or so it just showed the default WordPress installation screen.

Some people seem to think they've been hacked when they see this screen as it indicates the database is totally gone. The most common cause for this however is that the WordPress table wp_options has crashed or become corrupted and needs repairing.
If you have logging and access to the server you should see something like this:
./loginname_blog/wp_options' is marked as crashed and should be repaired
I have a simple control panel for my blog (DirectAdmin), most hosting will offer you something like this or something more complex like CPanel. You can find out what is corrupted by pressing the 'Check' button, if you just wish to go ahead and fix the problem use the 'Repair' option.

After the database is successfully repaired you should see something like this:

A similar operation can be done with MySQL via command line or via PHPMyAdmin quite easily.
Now this is all well and good, but it doesn't fix the source of the problem. You can't keep repairing every time your database crashes, it started happening to me almost daily.
From my research, it seems that having too many records in the wp_options table can cause things to get funky and make it likely to become corrupted. Mine had a staggering 6234 records, a 'normal' wp_options table should have about 500 maximum.
Now what I didn't realise that was every time I installed or tested a new plugin, it left a bunch of records in the wp_options table and when I removed it...it didn't remove the records.
So I had all kinds of junk in there from the past 4 years of upgrades and experiments plus a whole lot of RSS hashes (which you can get rid of too).
My recommended solution is to use Clean Options, which is a plugin for WordPress that allows you to clean up your wp_options file.

Just PLEASE PLEASE do some research and use it very carefully because it can destroy your install, I recommend that you backup your database before you start fiddling even if you're very sure what you're doing.
Before you delete anything do use the Google option and check out what created it, remember if you're using WordPress 2.8 there are transient entries that are not orphaned they are part of the new WordPress DB structure.
If you find anything from a plugin you no longer use you can safely delete it, you can ditch all the RSS hash entries. You have a far cleaner wp_options table after that!
I managed to take mine down to 234 rows, it's back up now due to the rss_hash entries but other than that it's pretty clean and slick and hasn't crashed since I've done the tidy up.
TweetTags: backup, clean options plugin, directadmin repair mysql, directadmin repair table, phpmyadmin, wordpress, wordpress backup, wordpress clean options, wordpress corrupt database, wordpress database corrupted, wordpress error, wordpress hacked, wordpress install, wordpress problem, wordpress repair table, wp_options, wp_options corrupted, wp_options crashed
Follow me on Twitter
Subscribe to RSS 
Related Posts:
- Converting bBlog 0.76 to WordPress 2.0 (Import/Export) Script
- How to use RSS Feeds on your WordPress Site
- What Religion Are You?
- A small change to WordPress to make WHOIS International
- So here we are, New Look for 2006! Happy New Year
- I am a Pundit blogger..
8 Comments so far
Leave a reply















Using
awesome plugin. on an unrelated note i wish there were revision management for themeing, i just lost my style.css which contains a lot of revision from the original, and here i am staring at my screen wondering what to do...
Using
thanks for the heads-up regarding this issue.
Using
oOo, and Wp 2.8 is out!
Using
Chriso: Haha, that one is your file management leh, I never overwrite the original file when editing. And you must have one copy either on the server or on your PC.
Michael Yip: No worries, hope you don't encounter it
KY: Yah, no major changes loh.
Using
situation solved. Mr Lee from IpServerOne contacted me back within 15 minutes while the staff there replied my e-mail (and this was during lunch hour) and they took me on a de-panicking ride, and within 30 minutes they got me back a copy of the file dated the night before with no charges, hassle-free.
Amazing host, superb support, which is why I'll be bringing my business to them!
(and this is all thanks to u for introducing him
)
Using
Chriso: And that's why I ALWAYS recommend IPServerOne, their support is insane.
Using
Hmmmm, regarding that issue, have you tried optimizing the table? It might help, but yeap, a thorough fix will be using the plugin. But do proceed with caution. I'm glad that it fixed the problem for you.
My initial diagnosis will be a disconnected database - there were a few instances in the past when the database got disconnected and my WP blog greets everyone happily with an installation page.
p/s: Glad that Chris found his style.css! It was a harrowing experience indeed.
Using
Teddy: Yah I did, I did both - clear out and optimize. It hasn't corrupted again since then so I hope it should be ok.