Skip to content

Instantly share code, notes, and snippets.

@itsmikita
Last active August 29, 2015 14:14
Show Gist options
  • Save itsmikita/09a6a58268b56e2f0762 to your computer and use it in GitHub Desktop.
Save itsmikita/09a6a58268b56e2f0762 to your computer and use it in GitHub Desktop.
Changing WordPress database table prefix
After renaming table names:
1.
UPDATE {$new_prefix}options SET option_name = "{$new_prefix}user_roles" WHERE option_name = "{$old_prefix}user_roles";
2.
UPDATE {$new_prefix}usermeta SET meta_key = "{$new_prefix}capabilities" WHERE meta_key = "{$old_prefix}capabilities";
3.
UPDATE {$new_prefix}usermeta SET meta_key = "{$new_prefix}user_level" WHERE meta_key = "{$old_prefix}user_level";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment