Skip to content

Instantly share code, notes, and snippets.

@flowtwo
Last active February 1, 2017 08:58
Show Gist options
  • Save flowtwo/7960270 to your computer and use it in GitHub Desktop.
Save flowtwo/7960270 to your computer and use it in GitHub Desktop.
Renaming existing WordPress tables for security reasons
/* STEP 1 */
RENAME table `wp_commentmeta` TO `prefix_commentmeta`;
RENAME table `wp_comments` TO `prefix_comments`;
RENAME table `wp_icl_content_status` TO `prefix_icl_content_status`;
RENAME table `wp_icl_core_status` TO `prefix_icl_core_status`;
RENAME table `wp_icl_flags` TO `prefix_icl_flags`;
RENAME table `wp_icl_languages` TO `prefix_icl_languages`;
RENAME table `wp_icl_languages_translations` TO `prefix_icl_languages_translations`;
RENAME table `wp_icl_locale_map` TO `prefix_icl_locale_map`;
RENAME table `wp_icl_message_status` TO `prefix_icl_message_status`;
RENAME table `wp_icl_node` TO `prefix_icl_node`;
RENAME table `wp_icl_reminders` TO `prefix_icl_reminders`;
RENAME table `wp_icl_strings` TO `prefix_icl_strings`;
RENAME table `wp_icl_string_positions` TO `prefix_icl_string_positions`;
RENAME table `wp_icl_string_status` TO `prefix_icl_string_status`;
RENAME table `wp_icl_string_translations` TO `prefix_icl_string_translations`;
RENAME table `wp_icl_translate` TO `prefix_icl_translate`;
RENAME table `wp_icl_translate_job` TO `prefix_icl_translate_job`;
RENAME table `wp_icl_translations` TO `prefix_icl_translations`;
RENAME table `wp_icl_translation_status` TO `prefix_icl_translation_status`;
RENAME table `wp_links` TO `prefix_links`;
RENAME table `wp_options` TO `prefix_options`;
RENAME table `wp_postmeta` TO `prefix_postmeta`;
RENAME table `wp_posts` TO `prefix_posts`;
RENAME table `wp_terms` TO `prefix_terms`;
RENAME table `wp_term_relationships` TO `prefix_term_relationships`;
RENAME table `wp_term_taxonomy` TO `prefix_term_taxonomy`;
RENAME table `wp_usermeta` TO `prefix_usermeta`;
RENAME table `wp_users` TO `prefix_users`;
/* STEP 2 */
SELECT * FROM `prefix_options` WHERE `option_name` LIKE '%wp_%'
/* STEP 3 */
SELECT * FROM `prefix_usermeta` WHERE `meta_key` LIKE '%wp_%'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment