Skip to content

Instantly share code, notes, and snippets.

@hluker
Last active June 5, 2020 10:19
Show Gist options
  • Select an option

  • Save hluker/69e90892988cb0595b985d7cf4fb69e9 to your computer and use it in GitHub Desktop.

Select an option

Save hluker/69e90892988cb0595b985d7cf4fb69e9 to your computer and use it in GitHub Desktop.

Revisions

  1. hluker revised this gist Jun 5, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion sql_commands.md
    Original file line number Diff line number Diff line change
    @@ -3,4 +3,4 @@
    UPDATE wp_posts SET post_content = replace(post_content, 'http://oldsite.com', 'http://newsite.com');
    UPDATE wp_links SET link_url = replace(link_url, 'http://oldsite.com', 'http://newsite.com');
    UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://oldsite.com', 'http://newsite.com');
    UPDATE wp_posts SET guid = replace(guid, 'http://oldsite.com','http://newsite.com');
    UPDATE wp_posts SET guid = replace(guid, 'http://oldsite.com', 'http://newsite.com');
  2. hluker revised this gist Jun 5, 2020. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion sql_commands.md
    Original file line number Diff line number Diff line change
    @@ -2,4 +2,5 @@
    UPDATE wp_options SET option_value = replace(option_value, 'http://oldsite.com', 'http://newsite.com') WHERE option_name = 'home' OR option_name = 'siteurl';
    UPDATE wp_posts SET post_content = replace(post_content, 'http://oldsite.com', 'http://newsite.com');
    UPDATE wp_links SET link_url = replace(link_url, 'http://oldsite.com', 'http://newsite.com');
    UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://oldsite.com', 'http://newsite.com');
    UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://oldsite.com', 'http://newsite.com');
    UPDATE wp_posts SET guid = replace(guid, 'http://oldsite.com','http://newsite.com');
  3. hluker created this gist May 5, 2020.
    5 changes: 5 additions & 0 deletions sql_commands.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    ## wordpress - find and replace domains
    UPDATE wp_options SET option_value = replace(option_value, 'http://oldsite.com', 'http://newsite.com') WHERE option_name = 'home' OR option_name = 'siteurl';
    UPDATE wp_posts SET post_content = replace(post_content, 'http://oldsite.com', 'http://newsite.com');
    UPDATE wp_links SET link_url = replace(link_url, 'http://oldsite.com', 'http://newsite.com');
    UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://oldsite.com', 'http://newsite.com');