Skip to content

Instantly share code, notes, and snippets.

@skvggor
Last active January 4, 2016 16:29
Show Gist options
  • Save skvggor/8648180 to your computer and use it in GitHub Desktop.
Save skvggor/8648180 to your computer and use it in GitHub Desktop.
Update "proto" to "production".
-- Update custom fields
UPDATE
`wp_postmeta`
SET
`meta_value` = REPLACE(`meta_value`, 'proto/', '')
WHERE
`post_id` > 0;
-- Update site URL
UPDATE
`wp_options`
SET
`option_value` = REPLACE(`option_value`, 'OLD-URL', 'NEW-URL')
WHERE
`option_name` = 'home' OR `option_name` = 'siteurl';
UPDATE `wp_posts` SET `guid` = REPLACE(`guid`, 'OLD-URL', 'NEW-OLD');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment