Support » Fixing WordPress » Run two sites from one database

  • Hi. I’ve been asked if it is possible to have two sites with the same content but different logos, image headers, etc. all while keeping the same content (posts, pages). More importantly it would be necessary to load content from one site only, to maintain both.

    Is this possible and is there and advisable way to do this?


Viewing 12 replies - 1 through 12 (of 12 total)
  • You can run two sites from a single database but not from the same set of database tables as the stored data includes the site’s domain name. Why would you want to do this anyway? You would risk being hit by Google’s duplicated content penalty.

    Well, a client needs to have the same products he’s selling on his WP site, on another WP site. So basically, he’s looking for a way to load content just once as opposed to either creating each post twice or copying/ pasting one by one.

    He would be using different domains by the way. Didn’t know about “Google’s duplicated content penalty”.

    I suggest you start reading up on this – otherwise both of your client’s sites will get hit by this penalty.

    Apparently is not a big deal, according to this and this but thanks for the advise.

    Could you please expand a bit more on your first answer or point the way to fully understand it?

    Thank you very much for your answers.

    You would use one database but change the table prefix for the second site during the install process so that the two sites store data independently from one another.

    Nothing is impossible! But there is no point keeping duplicate content on both places.

    If I understand it correctly, you want the same content without manually have to enter it twice on both sites.

    Regarding using the same database:
    There are two values in the options table: siteurl and home which are used. Using the same options table won’t work, even if you update options forcefully for each php run.

    So you would need to use two databases.

    You can use a mysql replicator, to replicate content from one database to another. Make sure to trigger a script at the end of replication to update the siteurl and home to the other domain values.

    You need to ensure that no content anywhere has urls which points to the same domain. If there are any such urls, you need to have procedures to replace the urls after replication.

    If your customer need only posts/pages content copies on both places, without the pain of manually copying them over, you can have them post the content via email:

    Have both instances read via email and make posts/pages from it.

    Hi sandyr,

    You are correct. The client wants to enter the content in one site and only once, and having it displayed in both.

    “Site 1” would be the same as “Site 2” (with different domain, header, footer), but the content/products should be the same.

    So I was aiming for a way/function/script or anything that would allow him to enter the content just once.

    Hi Carmdq,
    Does the branding info on the sites have to be customizable? If not, you can have one database and then the themes for each of the sites can be hard-coded with the site name/tagline/etc

    The site would be the same internally, using the same theme. But the header content, logo, etc. should be different. The site is using custom posts for products. Those posts should feed both sites.



    I’m looking to do the same thing, but haven’t figured it out quite yet. I found this post which seems like it points in the right direction. This post gets me to two separate sites/domains with the same exact content, and as long as the same plugins and themes are installed on both, you can work on edits/changes to the theme/plugin files on one site without affecting them on the other site.

    Now to figure out how to use two separate options tables as well…. Anybody knows how to do this?



    @marketermatt: If you require assistance then, as per the Forum Welcome, please post your own topic. This topic references an old version of WordPress.


Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Run two sites from one database’ is closed to new replies.