Hey ltd2009,
That’s a great question, hopefully, someone comes up with a better idea, cause I only found what you found as far as
define(CUSTOM_USER_TABLE,’wp_users’);
define(CUSTOM_USER_META_TABLE,’wp_usermeta’);
and I don’t believe you can make those remote by themselves, you could always make site B connect remotely to the same database as site A under a different prefix (SiteA would connect to db as localhost, SiteB would connect to the host of site A, same user and password, different prefix) , and then I think you could use those defines so they use the same table for users and usermeta tables.
Inside SiteB wpconfig, things that would need to be changed:
define( ‘DB_NAME’, ‘siteA’s Db’ );
/** MySQL database username */
define( ‘DB_USER’, ‘SiteA’s User for DB’ );
/** MySQL database password */
define( ‘DB_PASSWORD’, ‘SiteA’s Password for DB’ );
/** MySQL hostname */
define( ‘DB_HOST’, ‘SiteA’s hostname’ );
define( ‘CUSTOM_USER_TABLE’, ‘SiteA’s table for users’ );
define( ‘CUSTOM_USER_META_TABLE’, ‘SiteA’s table for usermeta’ );
$table_prefix = ‘anything that is not what SiteA is using’;
Although that sounds like it might slow Site B down since it has to communicate with Site A hosting for the database.
this site goes over the basic idea of everything except how to connect to a remote DB for siteB, but everything else would stay the same.
https://trickspanda.com/wordpress-share-users-login/
But I think that would work,
I am not sure, I might try to do a test and see later, hopefully, someone has another solution.
-
This reply was modified 8 years, 3 months ago by
jamisonb.
-
This reply was modified 8 years, 3 months ago by
jamisonb.