Skip to content
Snippets Groups Projects

Replace Domain in Wordpress Databases

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    The snippet can be accessed without any authentication.
    Authored by Edward Bock
    Edited
    wp_db_replace.sql 905 B
    UPDATE  __prefix__options SET option_value = replace(option_value, '__from__', '__to__') WHERE option_name = 'home' OR option_name = 'siteurl';
    UPDATE  __prefix__posts SET guid = replace(guid, '__from__', '__to__');
    UPDATE  __prefix__posts SET post_content = replace(post_content, '__from__', '__to__');
    UPDATE  __prefix__postmeta SET meta_value = replace(meta_value,'__from__', '__to__');
    # grid
    UPDATE  __prefix__grid_box SET readmore_url = replace(readmore_url,'__from__', '__to__');
    UPDATE  __prefix__grid_box SET content = replace(content,'__from__', '__to__');
    UPDATE  __prefix__grid_box SET title_url = replace(title_url,'__from__', '__to__');
    UPDATE  __prefix__grid_container SET readmore_url = replace(readmore_url,'__from__', '__to__');
    UPDATE  __prefix__grid_container SET title_url = replace(title_url,'__from__', '__to__');
    
    # Bei Multisites immer auch die blogs tabelle noch manuell anpassen
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment