Forums

Two blogs working from one user database (2 posts)

  1. John25
    Member
    Posted 1 month ago #

    I have a current blog with a few thousand users and am going to launch a totally new blog, with a different domain name, but working from the same server.

    I would like to work from one user database base, but have different databases for content, plugins and so on.

    Searching the forum I have found multiple similar questions and asnwers, with possible solutions such as:

    - Wordpress MU
    - WP Hive
    - Redcoding wordpress

    Yet I cannot find one working example of the answers.

    Do you have a successful experience with having 2 blogs, 2 different themes and plugins, but 1 user database?

  2. stvwlf
    Member
    Posted 1 month ago #

    A way to do this that works is:

    You use the same database for both blogs. The 2nd blog uses a different tablename prefix than the first one. The setting for prefix is in each blog's wp-config.php file.

    Both are separate WordPress installations, using their own WordPress software installations and their own themes.

    There is no connection between the two sites other than their separate database tables are in the same database.

    The reason for doing it this way is you add code to the wp-config.php files telling the installations to use the users table from the first site on the second site.

    Share users between two blogs
    Put them both in the same database with different prefixes. Then choose one of them to be the master user table. Then do this in both wp-config.php files:

    define(CUSTOM_USER_TABLE,'wp_users');
    define(CUSTOM_USER_META_TABLE,'wp_usermeta');

    Replace the wp_ with the prefix you want.

    In other words, you designate the user table from ONE installation as the master user table which will be used by the other installations instead of their own user table. This PHP code must go in the wp-config.php file in all the installations that you want sharing a single user table. You can have more than two installations set up the same way. Their tables must all be in a single database however.

Reply

You must log in to post.

About this Topic