HOW TO CHANGE A MULTISITE PRIMARY DOMAIN

Hi,

What do I have to do to change primary domain in multisite?

Thanks

  • Nastia

    Hello juan , hope you're doing well!

    To change a primary domain name on a multisite you will require access to phpMyAdmin and change the URL inside site's tables. The tables that need to be edited are:

    - wp_options: options named “siteurl” and “home”
    - wp_site
    - wp_sitemeta: the option named “siteurl”
    - wp_blogs: any entries in the “domains” column that have the old domain name
    - wp_#_options: Each sub-site will have sets of tables that correspond to the blog_id in the wp_blogs table. You need to go to the wp_#_options table, where # corresponds to the blog_id, and update the “siteurl” and “home” settings in that table.

    Please make sure to create a full backup of your site. So if something goes wrong you can always restore your site back to the way it was.

    Also make sure to comment out any pre-defined constants in your wp-config.php file, as they will override settings in the database. Things such as:

    define( 'WP_HOME', 'http://site.com' );
    define( 'WP_SITEURL', 'http://site.com' );

    You can create backup with the Snapshot Pro plugin.

    The best practice is to have a development copy of your site, and test changing the site's URL there.

    Let me know if you have any further questions!

    Kind regards,
    Nastia

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.