Change your WordPress Database Prefix in a Minute

Time is the most valuable resource today. My pleasure is to create a tool that can save time. More info about how and why do you need to change WP database prefix read here.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
RENAME TABLE wp_comments TO uj0_comments;
RENAME TABLE wp_commentmeta TO uj0_commentmeta;
RENAME TABLE wp_links TO uj0_links;
RENAME TABLE wp_options TO uj0_options;
RENAME TABLE wp_postmeta TO uj0_postmeta;
RENAME TABLE wp_posts TO uj0_posts;
RENAME TABLE wp_terms TO uj0_terms;
RENAME TABLE wp_termmeta TO uj0_termmeta;
RENAME TABLE wp_term_relationships TO uj0_term_relationships;
RENAME TABLE wp_term_taxonomy TO uj0_term_taxonomy;
RENAME TABLE wp_usermeta TO uj0_usermeta;
RENAME TABLE wp_users TO uj0_users;
UPDATE uj0_options SET option_name = REPLACE(option_name, 'wp_', 'uj0_') WHERE option_name LIKE 'wp_%';
UPDATE uj0_usermeta SET meta_key = REPLACE(meta_key, 'wp_', 'uj0_') WHERE meta_key LIKE 'wp_%';

And do not forget to make changes in wp-config.php $table_prefix = 'uj0_';.