Created
April 21, 2015 11:58
-
-
Save hedii/68eb23fe46f7510bea43 to your computer and use it in GitHub Desktop.
Move Wordpress from localhost to a server
This file contains 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
## Paste all this SQL script in phpMyAdmin (SQL tab) ## | |
## WARNING: DON'T PUT ANY TRAILING SLASH AT THE END OF THE URL ## | |
# CHANGE WEBSITE URL | |
UPDATE wp_options | |
SET option_value = REPLACE(option_value, 'http://www.oldwebsite.fr', 'http://www.newwebsite.fr') | |
WHERE option_name = 'home' | |
OR option_name = 'siteurl'; | |
# CHANGE GUID URL (GLOBAL UNIQUE IDENTIFIER) | |
UPDATE wp_posts | |
SET guid = REPLACE(guid, 'http://www.oldwebsite.fr', 'http://www.newwebsite.fr'); | |
# CHANGE POST CONTENT URL | |
# (LINK, IMAGE, DOCUMENT) | |
UPDATE wp_posts | |
SET post_content = REPLACE(post_content, 'http://www.oldwebsite.fr', 'http://www.newwebsite.fr'); | |
# CHANGE POST META URL | |
UPDATE wp_postmeta | |
SET meta_value = REPLACE(meta_value, 'http://www.oldwebsite.fr','http://www.newwebsite.fr'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment