Ready to get started?Download WordPress


Multiple installations, same content : how? (9 posts)

  1. stephdumais
    Posted 8 years ago #

    Hi, I have two sub websites under the same domain, using different layouts and such. What I would like to do is have a WordPress installation in each of these directories, each using their own theme but accessing the same content in the database.

    In other words: two blogs, same database tables. *NOT* different tables as this would require that I duplicate content for each blog manually.

    Has this been done before? How can I achieve this?

  2. scaturan
    Posted 8 years ago #

    just use a different table prefix : http://codex.wordpress.org/Installing_Multiple_Blogs

  3. moshu
    Posted 8 years ago #

    that's whole idea that the OP doesn't want two different prefixes :)
    I have no idea whether it would work with two installs using the same DB tables...

  4. scaturan
    Posted 8 years ago #

    oh!, hahah, thanks for the heads up.

  5. vkaryl
    Posted 8 years ago #

    Couldn't one simply give both installs the same db info in the separate wp-config.php files? Or would that NOT work for some reason?

    Of course, even if that would work.... hmmm. Would you use just one blog for always posting? I'm wondering if there would be a problem if posting happened from both.... and what about commenting?

  6. red-star
    Posted 8 years ago #

    I have tried that. that went totaly wrong.

  7. stephdumais
    Posted 8 years ago #

    I discovered that the main problem involves absolute paths for archives and such.

    If there was a way to make them dynamic or if the theme could depend on the wp-config file only, it would make this possible.

    BTW, the reason I want to do this is to have two versions of my website but sharing the same content.

    Here's hoping someone has come up with a plugin or some simple hack...

  8. Kafkaesqui

    Posted 8 years ago #

  9. lunabyte
    Posted 8 years ago #

    Have you tried this?

    I'm guessing this is a somewhat fresh install.

    1) Install a second copy of WordPress, using a second table_prefix.

    2) Using something like PhpMyAdmin, drop all of the tables with the new table_prefix EXCEPT "options".

    3) Open up the config file, and change the table_prefix to the original table prefix.

    4) Open up wp-settings.php and scroll down to about line 75 or so, where it lists the table names. there will be a bunch of lines like:

    wpdb->tablename = table_prefix 'tablename'

    edit the line for the options table like so:
    $table_prefix . 'options'


    Note: new_prefix is the prefix you used in the second install, which is different from the first. So, if your new prefix was blog2_, the edited version would look like:

    This way, you're using the options/settings from the second install, and can customize it separately from the first.

Topic Closed

This topic has been closed to new replies.

About this Topic