Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

My question is this:

Is it possible to have two separate installations of WP with two separate domains sharing the same content?

Scenario: User on http://A.mysite.com publishes a post. http://B.mysite.com uses the exact same database and can show that post as if it was its own.

I've been looking around for quite some time for this solution and cannot find a valid procedure to achieve this.

My ideas are:

  1. Is there a way to share the database without having the issue of the siteurl and theme stored in the database be an issue.
  2. Maybe use just an RSS feed and somehow parse the XML and display them in a template. This is not the best idea because it would have zero functionality that WordPress provides.
  3. Find a way to somehow sync the databases but exclude the wp_options table ?
share|improve this question
    
Only theme is different in both domains or they may have different plugins, admin settings and options? –  M-R Dec 13 '12 at 19:32
    
Will site B need to be edited on it's own as well? Or is it strictly a mirror with no unique administration? –  Kristina Childs Dec 13 '12 at 20:14
    
The theme would be different as well as some of the plugins and admin settings. –  Vincent Listrani Dec 13 '12 at 20:21
    
Kristina, It would be strictly a mirror. Only purpose is to display the blog posts from the original site. –  Vincent Listrani Dec 13 '12 at 20:23
    
You might want to look into the effect this would have on SEO. I'm pretty sure Google doesn't like duplicate content. –  Zach L Dec 13 '12 at 20:26

2 Answers 2

up vote -1 down vote accepted

If your main requirement is to synchronise blog posts from a master site to a slave, then maybe look at the FeedWordPress plugin. It means that you would only add/edit posts on one website and they would be replicated to the other site. That will allow you to cleanly run different plugins on the two sites.

share|improve this answer
    
webaware, thank you very much! That is exactly the situation we need to preceed with and this plugin is a near perfect solution to this issue. It doesn't require any massive database syncing or unstable hacks to the WordPress theme. In fact the only thing I have to add was a function to include the post's featured image using the_content_rss filter. Thanks a million. I will also be donating to this developer's plugin. Cheers. –  Vincent Listrani Dec 14 '12 at 2:07
    
Yes, it got me out of a bind on a site I did too. Very handy! –  webaware Dec 14 '12 at 2:42

If the URLs are the only difference between the installs you can edit one of the config.php files and add

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

and to the other config.php add

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

Both installs will use the same database info only the URLs being different.

However you will have to take care of other possibly different aspects like plugins, users, theme, and so on.

The same way you can define any other different setting case by case.

share|improve this answer
    
exactly what i was thinking. you can define your site URL (without futzing with rewrites) and where your site actually lives. –  Kristina Childs Dec 13 '12 at 22:05
    
Yes but doesn't that action write to the wp_options database table and change those fields? If so, then it would change it each time someone loads the page and would disable the other site or cause other errors. –  Vincent Listrani Dec 13 '12 at 22:54
1  
You would also have to worry about all of the links inserted into the post, which would be inserted based on the configuration of whatever site is being used to create or edit the particular post. –  s_ha_dum Dec 13 '12 at 23:38
    
Vinccent, if you use define as described it will not write in the database because update_option is not used in the process –  K Themes Dec 14 '12 at 8:55
    
K Themes, Thank you for this information. I will also test this theory. The only thing keeping me from using it is the fact that any changes made on the slave site in terms of plugins an updates might interfere with the master site. –  Vincent Listrani Dec 14 '12 at 14:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.