Skip to content

Instantly share code, notes, and snippets.

@gregoirenoyelle
Last active November 25, 2015 20:24
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save gregoirenoyelle/2419465 to your computer and use it in GitHub Desktop.
Save gregoirenoyelle/2419465 to your computer and use it in GitHub Desktop.
WordPress SQL
## 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');
@jo-wp
Copy link

jo-wp commented Nov 25, 2015

Nice !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment