Skip to content

Instantly share code, notes, and snippets.

@liquid1982
Created December 1, 2010 08:57
Show Gist options
  • Save liquid1982/723187 to your computer and use it in GitHub Desktop.
Save liquid1982/723187 to your computer and use it in GitHub Desktop.
Query used to update the domain while moving a wordpress installation to a new domain.
SET @old = 'http://old'; # Vecchio dominio - da cui si trasferisce l'installazione
SET @new = 'http://new'; # Nuovo dominio - verso cui si trasferisce l'installazione
UPDATE wp_options SET option_value = replace(option_value, @old, @new) WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, @old, @new);
UPDATE wp_posts SET post_content = replace(post_content, @old, @new);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment