Skip to content

Instantly share code, notes, and snippets.

@loorlab
Created May 9, 2024 17:49
Show Gist options
  • Save loorlab/d8e7700ee1517f55cbf5244c0fa7d360 to your computer and use it in GitHub Desktop.
Save loorlab/d8e7700ee1517f55cbf5244c0fa7d360 to your computer and use it in GitHub Desktop.
Query WP - SQL - Change the table prefix for WordPress
update NEWPREFIX_usermeta set meta_key = 'NEWPREFIX_capabilities' where meta_key = 'OLDPREFIX_capabilities';
update NEWPREFIX_usermeta set meta_key = 'NEWPREFIX_user_level' where meta_key = 'OLDPREFIX_user_level';
update NEWPREFIX_usermeta set meta_key = 'NEWPREFIX_autosave_draft_ids' where meta_key = 'OLDPREFIX_autosave_draft_ids';
update NEWPREFIX_options set option_name = 'NEWPREFIX_user_roles' where option_name = 'OLDPREFIX_user_roles';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment