I have a WordPress installation at the document root for a domain, and then an additional installation in an immediate subdirectory of that installation such that I may use different themes for the two. I want to link the two sites logins so that you don't have to login twice in order to use both sites.

My coding skills are not great, so an easy fix or an of the shelf plugin are preferred.

  • Are you talking about a subdomain, or simply a sub-directory? A subdomain would be something along the lines of subdomain.bradleycountypulse.com, but all you mention is the /classifieds sub-directory (or URL component). Assuming that both URLs use the same WordPress installation and same database, there is no reason that the two would not already share the same login session... Have you installed WordPress twice? Is there any reason that you need to have two separate WordPress installations?
    – bosco
    Jan 27, 2014 at 20:54
  • Playing around with your linked site, it appears to me as though you do indeed have two seperate WordPress installations - one located at bradleycountypulse.com and the other at bradleycountypulse.com/classifieds. Or is this a single multisite installation?
    – bosco
    Jan 27, 2014 at 20:57
  • I had to use two installs because of the unique features of the classifieds page, a special theme was needed.
    – Jason
    Jan 27, 2014 at 20:59
  • I wanted to use the sahifa theme for the main site, and then have classifieds pick up after clicking that link
    – Jason
    Jan 27, 2014 at 21:01
  • In the event you need multiple sites for, e.g., a company intranet that needs to share logins, the Google Apps Login plugin is perfect (if your company uses Google Apps, o' course).
    – Ryan
    Feb 8, 2016 at 22:33

2 Answers 2


You can share user tables between different WordPress installations by installing the second site ("Site B") to use the original site's ("Site A") database, then choosing to use an alternate table prefix during installation so as to keep the rest of the data separate.

The second part of the problem is sharing login cookies between the two installations (what WordPress uses to keep track of login/"session" data). In order to do this, you must use the same cookie-path for both sites.

After installation, open the wp-config.php file in Site B's installation root, and add (or replace) the following lines shortly after the database configuration, modifying them as needed to fit your configuration:

$cookiehash = md5("http://www.bradleycountypulse.com/");  // Use Site A's URL

define(CUSTOM_USER_TABLE,'wp_users');           //Change 'wp' to match the prefix set during
define(CUSTOM_USER_META_TABLE,'wp_usermeta');   //  Site A's installation
define('COOKIEPATH', '/');                      //This path should reference Site A's root
define('SITECOOKIEPATH', '/');                  //Should match 'COOKIEPATH'
define('COOKIEHASH', $cookiehash );

Note that this will only work if the two installations reside on the same domain (which yours do!).

An alternate solution would be to setup the entire system as a single multisite installation.

Still another solution (albeit one that requires more legwork) would be to employ custom page templates on a single installation.

  • Thank you, I think I can handle that! I will delete the second WP install and attempt to share databases.
    – Jason
    Jan 27, 2014 at 21:55
  • Sure thing! Let me know how it goes - I've never actually done this myself. We may need to do a little finagling to get everything working properly.
    – bosco
    Jan 27, 2014 at 22:32
  • thank you for this! I've been looking at 10s of solutions and no combination worked except this. Feb 25, 2016 at 17:57
  • I know this hasn't been updated in a while, but is it possible to use this method on a website that is already on a subdomain?
    – Chef Mike
    May 20, 2017 at 21:29
  • @WeirdMike it should work as long as both sites share the same TLD. To use this method though, you'll have to do a little bit of a fancy database merge. The contents of the users and usermeta tables from the child site need added to the parent site's tables, respectively - but ID conflicts will need to be resolved. You might be able to use WordPress's import/export tool for this purpose. The rest of the child site's tables then need to be added to the parent db, giving them a new table prefix to keep them seperate from the parent's tables. Then, any field in the child site's new tables
    – bosco
    May 21, 2017 at 2:22

I have released a wordpress plugin based on the following article:


User Session Synchronizer allows you to keep the user logged in from one wordpress to another by synchronizing user data and cookie session based on a verified email.

The user email is encrypted based on the current user ip and a secret key shared by the synchronized wordpress installations.

You can find the plugin here:


And participate here:


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