GUID doens't change after cloning

After cloning a a network site it seems like "Cloner" doesn't change the GUID of the page(s) in the post table. The entry in the "guid" column does still contain the domain name of the site which was cloned and not of the new site.

  • Ash

    Hello @Lars Foth

    Welcome to WPMU community!

    I hope you are well today and thanks for asking the question.

    Yes GUID is not changed when you clone a site. In fact, GUID should not be changed according to codex: https://codex.wordpress.org/Changing_The_Site_URL#Important_GUID_Note

    I am not pretty sure for a cloned site it has any advantage or disadvantage, so I am tagging the developer @Ignacio for his valuable opinion on this.

    Cheers
    Ash

  • Ignacio

    Hi @Lars Foth. Ash is right, GUID column should not be used or changed. The column is not even used to get the post/attachment URL in WordPress. Guid means Glogbal Unique Identifier and though the Guid is a URL, it should not be used as such.

    There's a function called get_the_guid that its description is the following one: "The guid will appear to be a link, but should not be used as an link to the post. The reason you should not use it as a link, is because of moving the blog across domains".

    Regards.
    Ignacio.

  • Ash

    Hello @Lars Foth

    About the Infinite SEO issue, would you please create a new thread to keep things separate? I believe the issue is Infinite SEO related.

    About not coping the email address, this is default behavior. So, that you can set new email address in a new cloned site. But you can use a little code snippet to copy the email address too. Please try the following:

    add_filter( 'wpmudev_copier_exclude_settings', 'wpmudev_copier_exclude_settings_cb', 10, 1 );
    function wpmudev_copier_exclude_settings_cb( $exclude_settings ) {
    
      if (($key = array_search('admin_email', $exclude_settings)) !== false) {
        unset($exclude_settings[$key]);
      }
    
      if (($key = array_search('new_admin_email', $exclude_settings)) !== false) {
        unset($exclude_settings[$key]);
      }
    
      return $exclude_settings;
    
    }

    You can add those codes in mu-plugins. To use mu-plugins, go to /wp-content/ and find the folder with name 'mu-plugins'. If there is no folder in that name, then create a folder, name it 'mu-plugins', create a file inside that, give any name you like and paste the code in there. You don't need to activate that plugin. Mu-plugins means must use plugins, so it will be activated automatically always. If you use mu-plugins then add a php start tag at the beginning of the code.

    Hope it helps :slight_smile: Please feel free to ask more question if you have any.

    Cheers
    Ash

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.