Skip to content

Instantly share code, notes, and snippets.

@mandiwise
Last active May 29, 2016 19:47
Show Gist options
  • Save mandiwise/4f9c5c3e1d992f2169ae093285902fcb to your computer and use it in GitHub Desktop.
Save mandiwise/4f9c5c3e1d992f2169ae093285902fcb to your computer and use it in GitHub Desktop.
Renaming WP Database Table Preifx
RENAME table `wp_commentmeta` TO `NEWPREFIX_commentmeta`;
RENAME table `wp_comments` TO `NEWPREFIX_comments`;
RENAME table `wp_links` TO `NEWPREFIX_links`;
RENAME table `wp_options` TO `NEWPREFIX_options`;
RENAME table `wp_postmeta` TO `NEWPREFIX_postmeta`;
RENAME table `wp_posts` TO `NEWPREFIX_posts`;
RENAME table `wp_terms` TO `NEWPREFIX_terms`;
RENAME table `wp_termmeta` TO `NEWPREFIX_termmeta`;
RENAME table `wp_term_relationships` TO `NEWPREFIX_term_relationships`;
RENAME table `wp_term_taxonomy` TO `NEWPREFIX_term_taxonomy`;
RENAME table `wp_usermeta` TO `NEWPREFIX_usermeta`;
RENAME table `wp_users` TO `NEWPREFIX_users`;
UPDATE `NEWPREFIX_options` SET `option_name` = 'NEWPREFIX_user_roles' WHERE `NEWPREFIX_options`.`option_name` = 'wp_user_roles';
UPDATE `NEWPREFIX_usermeta` SET `meta_key` = 'NEWPREFIX_capabilities' WHERE `meta_key` = 'wp_capabilities';
UPDATE `NEWPREFIX_usermeta` SET `meta_key` = 'NEWPREFIX_user_level' WHERE `meta_key` = 'wp_user_level';
UPDATE `NEWPREFIX_usermeta` SET `meta_key` = 'NEWPREFIX_user-settings' WHERE `meta_key` = 'wp_user-settings';
UPDATE `NEWPREFIX_usermeta` SET `meta_key` = 'NEWPREFIX_user-settings-time' WHERE `meta_key` = 'wp_user-settings-time';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment