Support » Networking WordPress » Change Domain of Primary Blog

  • Is there a simple way to change the primary domain of a multi-site installation? I’d rather not rebuild from scratch …

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator Ipstenu (Mika Epstein)


    Lead Plugin Wrangler

    I know you can, because I did, but I can’t remember how I did it… I know it involved changing site 1 to point someplace OTHER than the main and then playing with the database and the WP-config.php file to tell it my main site was site 3, but I didn’t make note of the specifics.

    If I had to do it again, i would export and import instead.

    Export and import sounds easy enough but here’s the problem:

    When I export it strips out all the iframe tags. The central feature of my site is a bunch of specific Google maps, i.e. iframes. I’m pretty good with code, but I’m a database dunce. Is there a way to easily export and import without stripping out things that WordPress deems to be unimportant?

    Moderator Ipstenu (Mika Epstein)


    Lead Plugin Wrangler

    Huh. Never being one for iFrames in posts, I didn’t know that.

    Okay. Use at your own risk, make good backups, and be ready to back it out if it goes up in smoke.

    In your wp-config.php there are a couple lines:

    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 1 );

    I changed mine to

    define('SITE_ID_CURRENT_SITE', 3);
    define('BLOGID_CURRENT_SITE', '3' );

    I THINK I also had to make a change in the database, as I remember a problem when I added new sites. wp_site has my main domain listed, and I believe I changed the ID from 1 to 3 there as well.

    There are a number of tags that WordPress likes to throw away.
    and <p> are the most obvious. <iframe> is in there with it. That’s handy sometimes, but I’d really like to be able turn that feature off at times.

    I’d love to try your suggestion but without concrete steps, I’m quite sure I’m going to muck it up.

    Using the software is it even possible to change the name of the primary blog/domain? If not, I think that should go on the “to do” list for those smarter than I.

    How about, I create a brand new install of multi-site with the new domain as my primary domain. Then, 1 by one I export my bushel-barrel-full of sites to that domain?

    That’s painful to just think about …

    Andrea Rennick


    Customer Care at Copyblogger Media and Studiopress

    Just go change all instances of the old domain to the new one in the database.

    If you;re going from a .net to a .com, then it’s as easy as a search & replace.

    And, yes, we have written about this many, many times here in the forums and there are loads of blog posts out there.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Change Domain of Primary Blog’ is closed to new replies.