The other day, Klint Finley wrote a very good walkthrough of using the new Multisite functionality of WordPress 3.0. In the comments, a lot of people wanted to know how to use your own domain names. Since I’m doing that now, here’s a quick walkthrough/how-to guide.

Step 1: Manual Plugin Installation

The Domain Mapping plugin is not your regular kind of plugin. You cannot install it through the normal Plugins->Add New menu. Well, actually, you can, it just won’t work.

So first, download the plugin manually.

Note: For this tutorial, I will be using the WordPress MU Domain Mapping plugin. However, I am using the trunk version of the plugin. It has fixes in it that you will need for proper 3.0 support. Don’t try it with the regular version. (Note: The regular version works fine. This was originally written before the latest version, or 3.0, was released.)

The plugin has two main files you need to put in the proper places.

Domain mapping php file location

The first file is the domain_mapping.php file. This needs to go into the mu-plugins folder. The mu-plugins folder is a special folder, which you may not even have yet. Just create it underneath the wp-content folder and put that file into it.

Sunrise php file location

The second file is the sunrise.php file. This is a special filename for WordPress. Don’t worry about it, just put it in the wp-content folder.

Step 2: Activate Sunrise

Now you need to edit your wp-config.php file. Add this line of code to it:

define( 'SUNRISE', 'on' );

Simple, really. This will cause WordPress to go load that sunrise.php file and use it.

Step 3: Server info

Now you have to configure the domain mapping plugin so that it knows what it’s doing properly. This is easy to do, really. Go to your main domain’s admin page and log in as a super admin. Then go to the new Super Admin->Domain Mapping menu.

Domain mapping setup screen

Here you have a few different options, but two main ones that count. You can either put in the IP address of your server (as defined in your domain’s main A record) or you can put in a CNAME that points to your server. The IP address is what most people will want to use. If your server uses more than one, you can enter them all here, separated by commas.

Other options on this page:

  • Remote Login – This will make your login pages for all sites redirect to your main site to do the actual login. The benefit of this is that when you log in to one, you log into all of them. The downside is that the URL changes to another domain in order to log in.
  • Permanent redirect (better for your blogger’s pagerank) – This makes your subdomain or subdirectory sites redirect to their domains. You should leave this on.
  • User domain mapping page – Turn this on if you want users to be able to put in their own domains for mapping.
  • Redirect administration pages to blog’s original domain (remote login disabled if redirect disabled) – This makes all admin pages show up on the original domain instead of on the new domains. You need this enabled for remote login to work.

Generally I leave only the middle two on. Remote-login is iffy at best, and I want my new domain name to show up everywhere.

Step 4: Mapping the Domain

There’s a bit of a prerequisite here before you do this. When you buy a new domain, you will need to edit its DNS settings to actually point to your server IP or CNAME or whatever you do to make the domain connect to your server. For me, I just give it a new A record with my server IP in it. Easy.

Update: Okay, so there may be more to it than just that, depending on your host. Every host is different, and you’ll have to talk to your host to make them able to point the domain name at your existing site. How to do this varies from host to host, but the important thing is that when you visit your new domain (before you do this!) then you want it to go to your main site, as is.

There’s two ways you can actually map a domain to one of your sites. The user screen is the simplest way, if you left that option on before. Log into the site you actually want to map to a new domain, then go to Tools->Domain Mapping.

User Domain Mapping Screen

All you really do is put in a new domain and set it as the primary. Simple.

Note that if you didn’t get the domain pointed at your server before doing this, then your site will instantly vanish from the realm of mortal man. Setting the primary domain takes effect instantly. You won’t be able to access the site through the old domain any more.

The other way to set domain mapping is through the Super Admin->Domains menu. Here you’ll find a list of sites and their ID numbers. You can map an id number directly to a domain name here. The Tools approach is a bit easier to use, but this will allow you to map domains without visiting them, as you can access this list from your main domain. You can also correct broken domain mappings from here.

Step 5: Seeing the Mapped Domains

If you go to Super Admin->Sites, you’ll find this type of a listing:

Sites listing

You’ll note that on the right hand side you can see the column showing the mapped domains.

Special Note: See in the picture how I’m using a subdirectory install? That’s relatively new. In older versions of the domain mapping system, you had to use a subdomain installation and wildcard DNS for domain mapping to work. This is no longer the case, domain mapping works just fine with subdirectories.


And that’s how it’s done. It’s not super complex, but it does require some knowledge of DNS and how servers work. If you can successfully set up a multi-site install to begin with, you can probably do this as well. Just be aware that it is slightly finicky, and know that you will break your site if you put in the wrong settings somewhere. However, your main domain will always be accessible as long as you don’t try to map it, so you’ll be able to go in from there to correct your mistakes.



  1. Hi Otto!

    Do you know if it is possible to use the domain mapping plugin if the domain I’m mapping to is an ‘ADD ON’ domain, instead of ‘PARKED’?


    main domain:
    site I want to map:
    I want to map it to:

    I was able to map it ( works fine), but every link is still*, e.g.: if you hover on a picture in, the link the user sees is
    Also, the admin page is

    I believe this is because is an add-on domain in my hosting, not a parked one.

    I really wish I could use it like this, but with correct links.

    Do you know if this can be done?

  2. Hello, I also wanna do the same thing as Guto G.

    Please give us some advices.

    Thank you.

  3. Hello there!

    I think everything gets fixed by going to “Sites” administration, “Edit” your site, and filling in the “Settings” tab the “Siteurl” and “Home” fields with your mapping domain.

    Following the “Guto G” example, you should:

    – Edit “” site
    – Click on “Settings” tab
    – Set “Siteurl” and “Home” fields with “” (no quotes, obviously)

    And make sure that in “Domain settings” ( you have disabled the option “Redirect administration pages to site’s original domain”. If not, you will be redirected to “” when you go to “”. And since you has changed the “Siteurl” and “Home” values to “”, you will not reach the admin pages when redirected to the subdomain “”.

    Hope it helps.

    BTW, Otto, I think this piece of explanation should be in any of your tutorials (here or in WordPress plugins) as you tend to think that doing all the mapping stuff will be enough for the images and everything taking the right URLs, and that’s not true.

    I even went to the hardest path (before guessing the easy previous one) adding this to the “domain_mapping.php” file…

    add_filter( 'upload_dir', 'domain_mapping_uploads_uri');

    function domain_mapping_uploads_uri( $dirs ) {
    $dirs['url'] = domain_mapping_themes_uri($dirs['url']);
    $dirs['baseurl'] = domain_mapping_themes_uri($dirs['baseurl']);
    return $dirs;

    … in order to get the right URLs for the uploaded files.

    Thanks for reading.

  4. Hi,
    I’m using WordPress MultiSite with the insanenly helpful domain-mapping plugin. It works like a charm, but the login to the admin dashboard (both as a normal editor and as a global administrator) takes extremly long. It takes up to 3 minutes to login. I’ve tested it on Firefox and IE.

    Attached are my settings of the domain mapping plugin:

    What can I do to solve the problem?

    Thanks in advance

  5. Hey Otto, I need your help!
    I am using WP for (website A). I just purchased a 2nd domain (website B) and am trying to create the site in WP, yet am having trouble. I try to ADD NEW under sites, yet WP automatically includes website A in the new site address link. :( How do I get around this?
    My 2nd domain is completely a separate site from website A. The domain name is

    This is my only option I have when creating a new site:

    Site Name: _______ is NOT a part of the new domain, yet I can’t remove it or am given another option when creating the site name.

    How do I get around this?

  6. I tried the Domain Mapping plugin, but it did not work. So I installed WP again and created a new login, etc., though it wouldn’t let me use my domain b/c I already used it as a domain add-on. So I added a sub folder ( & it worked. Then I had to go back into my 1st WP account & redirect the domain (website B) to the new link with the sub folder. Craziness! You’d think it would have been an easy solution. I wish I had never did the domain add-on to begin with & just installed & created a new log-on, etc, but that’s what my host & wp forums said to do. Two days of my life was spent figuring this out, but thankfully now I have two working websites!!

    I could delete them both & start over, but I don’t want to risk the site not working again & going through the hassle a second time.

  7. Mapping my two child sites worked great… thanks for the comprehensive directions!

    I would also like to look into mapping my primary (parent) site to a different domain as well. There does not appear to be a way to do that via the WP admin area. Ideally I’d like to simply map a new domain to the primary site rather than go through the steps of changing the primary domain in the database.


  8. Hello,

    I have succesfully bound some domains to subsites in a multisite setting.

    Now I would like to use a domain wildcard. So I have and set to

    I would like to add * to

    I cannot do this with the plugin? Any example on how to do this with .htaccess?


  9. Hello:
    A quick background: I can configure C and A names in DNS, I have configured Virtual Host redirects, but I have never attempted the following and am stumped:
    Redirect a Domain name,

    to a WordPress multisite subdomain,

    Please help!

    Thank you in advance for your assistance.

Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Need to post PHP code? Wrap it in [php] and [/php] tags.