Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jassriver/3e6c3dd3b3b58497776ed011b5bc18b8 to your computer and use it in GitHub Desktop.
Save jassriver/3e6c3dd3b3b58497776ed011b5bc18b8 to your computer and use it in GitHub Desktop.
Query em SQL para mudar completamente a url do wordpress

Query SQL para mudar a url do Wordpress

Fique atento ao uso correto do prefixo da tabela do wordpress.

No caso deste exemplo, foi usado o prefixo wp_

UPDATE wp_options SET option_value = replace(option_value, 'antigaurl', 'novaurl') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'antigaurl','novaurl');
UPDATE wp_posts SET post_content = replace(post_content, 'antigaurl', 'novaurl');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'antigaurl','novaurl');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment