Skip to content

Instantly share code, notes, and snippets.

@jo-wp
Forked from gregoirenoyelle/wp-sql-mise-a-jour.sql
Last active August 29, 2015 14:22
Show Gist options
  • Save jo-wp/2b41945404b51ddd9927 to your computer and use it in GitHub Desktop.
Save jo-wp/2b41945404b51ddd9927 to your computer and use it in GitHub Desktop.
## Coller la totalite dans champs SQL de phpMyAdmin ##
## ATTENTION A NE PAS METTRE DE SLASH A LA FIN DES URL ##
# CHANGER URL DU SITE
UPDATE wp_options
SET option_value = REPLACE(option_value, 'http://www.vieuxsite.fr', 'http://www.nouveausite.fr')
WHERE option_name = 'home'
OR option_name = 'siteurl';
# CHANGER URL DES GUID (GLOBAL UNIQUE IDENTIFIER)
UPDATE wp_posts
SET guid = REPLACE(guid, 'http://www.vieuxsite.fr', 'http://www.nouveausite.fr');
# CHANGER LES URL DES CONTENUS DES ARTICLES
# (LIEN, IMAGE, DOCUMENT)
UPDATE wp_posts
SET post_content = REPLACE(post_content, 'http://www.vieuxsite.fr', 'http://www.nouveausite.fr');
# CHANGER LES URL DES DONNEES META DES POSTS
UPDATE wp_postmeta
SET meta_value = REPLACE(meta_value, 'http://www.vieuxsite.fr','http://www.nouveausite.fr');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment