Skip to content

Instantly share code, notes, and snippets.

@lanche86
Created March 10, 2013 11:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lanche86/5128240 to your computer and use it in GitHub Desktop.
Save lanche86/5128240 to your computer and use it in GitHub Desktop.
WordPress: Change the prefix of your database tables
// Change the prefix of your database tables
// If your old $table_prefix was wp_test_ and your new one is wp_, you need this query:
UPDATE `wp_usermeta` SET `meta_key` = replace(`meta_key`, 'wp_test_', 'wp_');
UPDATE `wp_options` SET `option_name` = replace(`option_name`, 'wp_test_', 'wp_');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment