Created
April 7, 2015 14:23
-
-
Save bytefade/14584d5761db11590ee3 to your computer and use it in GitHub Desktop.
lterando os caminhos absolutos, Wordpress. De URL até imagens e anexos.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Alterando os caminhos absolutos da URL do site (‘siteurl’) e URL da home (homeurl’) | |
UPDATE wp_options | |
SET option_value = REPLACE(option_value, | |
'http://www.siteantigo.com.br', 'http://www.sitenovo.com.br') | |
WHERE option_name = 'home' | |
OR option_name = 'siteurl'; | |
-- Alterar GUID | |
UPDATE wp_posts | |
SET guid = REPLACE (guid, | |
'http://www.siteantigo.com.br', 'http://www.sitenovo.com.br'); | |
-- Alterar URLs dentro dos conteúdos | |
UPDATE wp_posts | |
SET post_content = REPLACE (post_content, | |
'http://www.siteantigo.com.br', 'http://www.sitenovo.com.br'); | |
-- Alterar caminho das imagens | |
UPDATE wp_posts | |
SET post_content = REPLACE (post_content, | |
'src="http://www.siteantigo.com.br', 'src="http://www.siteantigo.com.br'); | |
-- e ainda nos attachments, precisamos alterar o GUID dos mesmos | |
UPDATE wp_posts | |
SET guid = REPLACE (guid, | |
'http://www.siteantigo.com.br', 'http://www.siteantigo.com.br') | |
WHERE post_type = 'attachment'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment