Correctly rename wordpress database tables prefix
Renaming wordpress database tables prefix could be useful for basically two reasons:
- you want to host more than one wordpress blog, however your hosting service is a bit mean and does not allow you more than one database
- you want to increase your database security
By default wordpress installations set wp_ as a prefix for each wordpress table name.
In order to rename these prefix
To make your wordpress site really secure, change the prefix to something that is difficult to guess. If security is not your first concern choose whatever prefix you want.
Edit your wp-config.php file and change
$table_prefix = ‘wp_’;
to
$table_prefix = ‘newprefix_’;
Change all your your WordPress table names
Go to phpMyAdmin and choose your WordPress database. Click on sql menu item and enter the command to rename all your tables. You might have several tables, hence keep renaming all of them using the command
rename table wp_table to newprefix_table;
You should then check wp_option table and ensure under the option_name column header wp_user_roles has been renamed to newprefix_user_roles. You will be able to change it by clicking on the edit button for that record.
The same applies to wp_usermeta and ensure the following tables have been renamed accordignly:
wp_user_level wp_capabilities wp_autosave_draft_ids
you can execute this command in order to rename all _usermeta istances
UPDATE `newprefix_usermeta` SET `meta_key` = REPLACE( `meta_key` , 'wp_', 'newprefix_' );
Related posts:
- No Sufficient Permissions for Upgrading WordPress
- WordPress 2.5 automatic plugin upgrade error
- wordpress delete old revisions
- Setting up SquirrelMail webmail
- wp-sticky does not stay on top
- Open Source CMS (Content management system) with Joomla!
Print This Post
|
Email This Post