Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jadark/bc776f57ba82d243f765daf75015c4b6 to your computer and use it in GitHub Desktop.
Save jadark/bc776f57ba82d243f765daf75015c4b6 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_A_USAR');
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';
-- UPDATEEEEEEEEEEEE!!!!!!!!!
UPDATE wp_options SET option_value = replace(option_value, 'https://www.bellezaadomicilio.com.pe', 'http://127.0.0.1:7000') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'https://www.bellezaadomicilio.com.pe','http://127.0.0.1:7000');
UPDATE wp_posts SET post_content = replace(post_content, 'https://www.bellezaadomicilio.com.pe', 'http://127.0.0.1:7000');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'https://www.bellezaadomicilio.com.pe','http://127.0.0.1:7000');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment