How to change wp table prefix in WordPress
Вставка
- Опубліковано 6 січ 2015
- 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'
Followed step by step I had a problem with wow commerce but still fixed it just follow step by step Cheers Anthony
Thank you for your clear and very helpful advice.
I have duplicate tables. What do I need to do?
Thanks dude
Great, thanks
but when I login wp_login.php then its redirect to wp install.php. how can i solve this
Thanks
I changed my table prefix from wp_ and when I applied the new one, it wanted me to reinstall wordpress? is that normal?
Melanie, you needed to change wp_ in the database as well. Did you?
you save me man thank you
Please comment me this source code.
Guys do not change your table prefix, it will do nothing to improve your security. On the flip side it can create problems for you. It is a loose loose situation. People telling you to change your database and table prefixes don't understand WordPress security.
quat