Manually Change The Wordpress Table Prefix
Ahem, WP Prefix Table Changer plugin is the great one. This tool will automatically change the default database table prefix to mitigate zero-day SQL Injection attacks. But unfortunately, not be a bit guys (include me) which has reported that they were unable to change their default Wordpress table prefix through that plugin. Generally, they’re get error message look like: “Your User which is used to access your Wordpress Tables/Database, hasn’t enough rights (is missing ALTER-right) to alter your Tablestructure”, so it mean we need another technique to encounter this problem. In actual fact, Blogsecurity.net in their Secure WP Whiteaper has briefly described to us about alternative technique which manually change the default Wordpress Table Prefix on our wordpress existing installation with a few additional steps. But, that method have potential risk to bite into our database, also requires not a few time to do so, why? ’cause some guys, like me too, have a bunch plugins which has been installed on their own blog, and of course it using the default wp_ prefix too, one of these are firestats.
By the way, i am successfully changing the default prefix (wp_) using my own method, see below:
- backup your wordpress database (i’m using phpmyadmin) to an *.sql file.
- open that *.sql file (make another copy first) using text editor, then find and replace all “wp_” prefix to “something_”, save it.
- now, drop all tables of your wordpress databases (don’t drop the database), of course it will make your wordpress database doesn’t have table (zero table).
- import the *.sql file which has been edited before into your wordpress databases through phpmyadmin.
- and lastly, edit your wp-config.php file and change the $table_prefix = ‘wp_’; to $table_prefix = ’something_’;
- done !

…it work perfectly for me !
Oh shit, i’m forgot to tell you a thing, by using technique above, your all plugins will be deactivated automatically, so you need to re-activated them.


From Chicago
Using
Hi, tha’s a nice tricks to changing the default wordpress.org prefix table, evenless since not a little bit people has got the error message when try to change their wp prefix using WP Prefix Table Changer plugin, or change it manually. Thanks a lot for that !
-Jonathan
The latest Jonathan’s blog post is Testimony
From Minneapolis
Using
yeah, your method will work fine, its a great idea
. but i think its more risky to do since the blog owner will dropping their all tables.
From Frosinone
Using
Ciao, got this url on Sherif Elsisi blog. I agree with Alex, this is a nice hack. Before using your step, i use a way written by Sherif Elsisi on his blog http://tdot-b..-wordpress but some wp_ prefix table still exist over there, like wp_user_level, wp_capabilities, wp_capabilities, wp_user_level, and wp_autosave_draft_ids.
And your steps above has renamed all these tables, everything is running so fine, now
.
Thanks,
Luigi
The latest Luigi’s blog post is Sembra di essere tornati al 96
From Jakarta
Using
Alex wrote:
yep, you’re right, but as mentioned above, I had suggested and/or told to take a backup first