Skip to content

Instantly share code, notes, and snippets.

@mickaelv
Last active August 2, 2019 09:08
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 mickaelv/45a00c82ee521672cb8c1202c99db34c to your computer and use it in GitHub Desktop.
Save mickaelv/45a00c82ee521672cb8c1202c99db34c to your computer and use it in GitHub Desktop.
Changer simplement l'URL dans WP depuis la BDD
SET @oldsite = 'URL', @newsite = 'URL';
UPDATE wp_options SET option_value = replace(option_value, @oldsite, @newsite) WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, @oldsite,@newsite);
UPDATE wp_posts SET post_content = replace(post_content, @oldsite, @newsite);
UPDATE wp_postmeta SET meta_value = replace(meta_value, @oldsite,@newsite);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment