Skip to content

Instantly share code, notes, and snippets.

@sarvar
Created October 10, 2021 07:17
Show Gist options
  • Select an option

  • Save sarvar/a9d8a89bacf0daa0741f83c672ee61a2 to your computer and use it in GitHub Desktop.

Select an option

Save sarvar/a9d8a89bacf0daa0741f83c672ee61a2 to your computer and use it in GitHub Desktop.

Revisions

  1. sarvar created this gist Oct 10, 2021.
    4 changes: 4 additions & 0 deletions mysql.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    UPDATE wp_options SET option_value = replace(option_value, 'oldurl.com', 'newurl.com') WHERE option_name = 'home' OR option_name = 'siteurl';
    UPDATE wp_posts SET guid = replace(guid, 'oldurl.com','newurl.com');
    UPDATE wp_posts SET post_content = replace(post_content, 'oldurl.com', 'newurl.com');
    UPDATE wp_postmeta SET meta_value = replace(meta_value,'oldurl.com','newurl.com');