Mapping Multiple Domains into Single Instance of WordPress

Mapping Multiple Domains into Single Instance of WordPressI have come across a need of mapping multiple domains into single instance of WordPress installation for my blog &  Then I did a search on the net, I found lot of references and plugins for single WordPress instance for multiple blog site within; take a look on top plugins for wordpress multisite but not for my need!

There are multiple ways to achieve mapping multiple domains into single wordpress installation (sharing everything except domain name).  I thought to create a blog post around these activities, perhaps it will benefit someone!

Note: Sharing same content across different domain might affect your SEO.

Approach Taken & Implemented

Below are the steps I followed for my blog.

  • Installed the WordPress into parent domain
  • Configured various plugins for my blog
  • Pointed second domain into parent domain IP through A record in DNS zone editor
  • Edited wp-config.php for two domain names according while accessing i.e. to reflect Site URL and  Site Home to respectively

Editing wp-config.php

  • Go to WordPress installed root directory and look for wp-config.php file
  • Place below lines after the table_prefix line; order is very important in wp-config.php , more info

  • Go to wordpress admin page and take a look at Settings -> General. You will have WordPress Address (URL) and Site Address (URL) will be in disabled state.  It means your wordpress installation dynamic enoungh to accomadate both domain address
Mapping Multiple Domains into Single Instance of WordPress

WordPress Admin -> Settings -> General



That’s it, now your WordPress instance have been enabled with multiple domain address.  I have shared the approach and step I followed for my blog. Make use of it!
  • Absolutely spot on dude, thanks for this snippet just used on a clients website, Saved me so much hassle figuring this out myself.

  • ismael

    Thank you very much, that’s what I was looking for!!

  • Brent Wallace

    Hi. I plan to try this, I hope it works. Are you limited to only TWO (2) domain names? Or could you use three or more? Thank you!

    • @Brent Wallace – It’s possible to map more than one name dynamically. It’s not limited to two.


  • KSuchdeve

    I was thinking about doing this, and saw this article as well. What are your thoughts on that?

  • It depends, for example serving similar content from different websites does affects SEO. Let’s you have more than one regional domain names for your websites with 301 redirects, will not affect SEO.


  • Thanks a lot :-) Exactly what I was looking for.

  • Will Lanni

    To clarify this: in your graphic above, you have written into both the WordPress Address and the Site Address. Did you actually set this so that the .com is in the WordPress address and the .mobi is written into the Site Address?

    • @willlanni:disqus Once we use above code snippet from article. WordPress will automatically disables ‘entering URL from settings page’, since its become dynamic to accommodate .com and .mobi domains as described above.


      • Will Lanni

        Oooh got it. Yeah, I did notice that it was disabled, now I get what you wrote.

        So your database is set up initially using the primary domain (… and then it just picks them up from the DNS zone editor… ok. that makes sense to me now, hope my server admin understands that. Thanks for responding!

  • David Rose

    I can’t quite get this to work – probably made some minor mistake, but not sure what to look at.

    I originally installed and wrote my site – this all works correctly.

    As a test I then set up as described in your article.

    However the home page doesn’t load correctly (wrong fonts and links still refer to original site).

    Any sub page seems to work ok, so if I go to say it all loads correctly and moving the mouse over any menu link again correctly shows the correct (the-roses-at-home) domain. It’s just when I go to the home page, all the links refer to the original domain and certain font’s don’t load at all (even though they load correctly on the other pages e.g social media Icons font)

    If any one has any suggestions as to why this might be happening I’d be grateful.

  • David Rose

    Ah, found my problem in an error “Font from origin ‘’ has been blocked from loading by Cross-Origin Resource Sharing policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘’ is therefore not allowed access.”

    Now to work out the solution.

  • David Rose

    all fixed, seems that the super-cache had an issue

    • @disqus_B9CcNve5uD:disqus – good to hear, its working!

  • Christoph

    Finally a solution which is simple and just works! Many thanks, this was exactly what I was looking for!

  • lis_locket

    Thanks for this – was very useful. I have a question which I hope you may be able to help with. I set my wordpress install within a directory called ‘site’. I pointed the 2 domains (for instance and I have to this directory and amended the wp-config file as you have stated. It all works fine for me – but another developer has told me that the url needs to be and respectively as he is having errors with javascript. I didnt think this is necessary? Although the wordpress install is within a directory – as the domains are pointing to this directory is should all work? He has said i’ll need to move the whole install to the root.

    • @lis_locket:disqus I’m Sorry about delayed response, bit occupied with my day job.

      Your question has two scenario, let’s go one by one-

      1. If domain (for eg. & points to directory called ‘site’ then that is root directory for that particular domain. And you have wordpress install with that. It should work and there is no harm here.

      2. If you have domain (for eg., has two wordpress install under directory called ‘site01′ & ‘site02′. It is called subdirectory wordpress installation then URL has to be and So here domain root directory is different from wordpress site’s root directory.

      Typically it’s a choice of URL structure you wanted to deploy. Let me know, if you have any query.


  • Rodrigo Azevedo


  • Greenline

    I am creating a small network using Post types. Each author is assigned to a post type and each author has an author page with their own posts. Can I with this code assign a different domain for each author page? I read that having multiple domains gives you negative google SEO point due to duplicate content…? Thanks!

    • @disqus_LYYYDV7yc2:disqus Yes, that’s true about SEO. However I believe as per your scenario it won’t cause any issue. Since each author will be having their own content. Good luck.


  • Juergen Tolksdorf

    Helped! Thanks for the article!

  • Ben Harris

    This is an incredibly simple solution to a complex problem, but keep in mind that with this configuration anyone can point a domain name at your IP.

    • Jiří Cerhan

      It’s actually not true. Yes anyone can point their domain A record on any ip, but it doesn’t mean the server will point it to a folder. It depends on your hosts (zones of whatever you call it) configuration.

  • I have configured my domain1 DNS to point domain2.

    I made the above change in my wp-config.php
    domain1 redirects to domain2 (with or without the change)

  • Twan Kouwenberg

    I just solved my problem through WPML


  • Jiří Cerhan

    Thanks, works just fine.