Skip to content

Instantly share code, notes, and snippets.

@hawkapparel
Created September 1, 2016 21:48
Show Gist options
  • Save hawkapparel/69163ea6cb2333fe713dcf169d033813 to your computer and use it in GitHub Desktop.
Save hawkapparel/69163ea6cb2333fe713dcf169d033813 to your computer and use it in GitHub Desktop.
//SCRIPT PARA CAMBIAR URLS EN WORDPRESS
//Con este script se actualiza las urls de la BD cuando se cambia de servidor un proyecto wordpress
//UPDATE wp_posts SET guid = replace(guid, 'URL_ACTUAL','URL_LOCAL');
UPDATE wp_posts SET guid = replace(guid, 'http://tuurldeproduccion.com.pe/','http://localhost/tuproyecto');
UPDATE wp_posts SET post_content = replace(post_content, 'http://tuurldeproduccion.com.pe/', 'http://localhost/tuproyecto');
UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://tuurldeproduccion.com.pe/', 'http://localhost/tuproyecto');
UPDATE wp_options SET option_value = replace(option_value, 'http://tuurldeproduccion.com.pe/', 'http://localhost/tuproyecto')
WHERE option_name = 'home' OR option_name = 'siteurl';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment