How to change wp table prefix in WordPress

Описание к видео How to change wp table prefix in WordPress

This Video shows to secure wordpress from hackers.
Steps Followed:
Open the Wp config.Php file of the WordPress, In the file search this :
$table_prefix = 'Instance_';
Against table_prefix we have used string as Instance, you can use anyname you want
The name you entered will change the default wp_ table prefix in the database.
Run the Wampserver on your Machine.
Now click on PhpMyAdmin
In PhpMyAdmin select the database where you want to make the changes.
Now under that database click on Sql, here we need to execute some commands, to change the wp_ default table prefix to our declared Instance
As there are total 11 (Eleven) tables where we need to change the wp_ default table prefix
Query we would use for all 11 changes would be:
RENAME table `wp_commentmeta` TO `Instance_commentmeta`;
RENAME table `wp_comments` TO `Instance_comments`;
RENAME table `wp_links` TO `Instance_links`;
RENAME table `wp_options` TO `Instance_options`;
RENAME table `wp_postmeta` TO `Instance_postmeta`;
RENAME table `wp_posts` TO `Instance_posts`;
RENAME table `wp_terms` TO `Instance_terms`;
RENAME table `wp_term_relationships` TO `Instance_relationships`;
RENAME table `wp_term_taxonomy` TO `Instance_taxonomy`;
RENAME table `wp_usermeta` TO `Instance_usermeta`;
RENAME table `wp_users` TO `Instance_users`;
Now update user meta fields so that application won't prevent you to log in.
Query:
UPDATE `Instance_usermeta` SET `meta_key` = REPLACE( `meta_key`, 'wp_', 'Instance_' )
Update options table data, Query we would use here is :
UPDATE `Instance_options` SET `option_name` = 'Instance_user_roles' WHERE `option_name` = 'wp_user_roles'

Комментарии

Информация по комментариям в разработке