Skip to content

Instantly share code, notes, and snippets.

@mksddn
Last active November 19, 2023 15:01
Show Gist options
  • Save mksddn/f093a16fa4f22deee04174a9969e96aa to your computer and use it in GitHub Desktop.
Save mksddn/f093a16fa4f22deee04174a9969e96aa to your computer and use it in GitHub Desktop.
SQL change/update/replace WP site url
UPDATE wp_options SET option_value = REPLACE(option_value, 'http://old-site.ru', 'https://new-site') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET post_content = REPLACE (post_content, 'http://old-site.ru', 'https://new-site');
UPDATE wp_postmeta SET meta_value = REPLACE (meta_value, 'http://old-site.ru','https://new-site');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment