Skip to content

Instantly share code, notes, and snippets.

@cpswsg
Created June 15, 2013 18:49
Show Gist options
  • Save cpswsg/5789130 to your computer and use it in GitHub Desktop.
Save cpswsg/5789130 to your computer and use it in GitHub Desktop.
Atualiza o banco de dados do WordPress para uma nova URL.
UPDATE wp_options
SET option_value = REPLACE(option_value, 'http://localhost/site', 'http://www.site.com.br')
WHERE option_name = 'home'
OR option_name = 'siteurl';
UPDATE wp_posts
SET guid = REPLACE (guid, 'http://localhost/site', 'http://www.site.com.br');
UPDATE wp_posts
SET post_content = REPLACE (post_content, 'http://localhost/site', 'http://www.site.com.br');
UPDATE wp_posts
SET guid = REPLACE (guid, 'http://localhost/site', 'http://www.site.com.br') WHERE post_type = 'attachment';
UPDATE wp_postmeta
SET meta_value = REPLACE (meta_value, 'http://localhost/site','http://www.site.com.br');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment