1

I have two WordPress websites on the same domain and on the same database. All my accounts created on the first main website also works on the second website and is automatically logging in.

But the administrator isn't functioning anymore. If I sign up as administrator and go to the intranet website I should be able to see a button only visible by administrator, also the back-end is blocked for me.

I made sure both websites are installed on the same server and the second website is linked to the users and usermeta tables. Also made sure both hashcodes are both identical. The following codes have been entered in the wp-config files:

Website https://www.pax-security.nl

define( 'COOKIE_DOMAIN', '.pax-security.nl' );
define( 'COOKIEPATH',    '/' );
define( 'COOKIEHASH',    md5( 'pax-security.nl' ) );

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

Website https://www.pax-security.nl/intranet

define( 'COOKIE_DOMAIN', '.pax-security.nl' );
define( 'COOKIEPATH',    '/' );
define( 'COOKIEHASH',    md5( 'pax-security.nl' ) );

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

Why is my administrator account on the first website an administrator account, while this same account is not an administrator account on the intranet website? I do am able to login with the same account in both websites.

1

User roles aren't stored in the user or user meta table, they have their own table, and they're on a per site basis so reusing them isn't so simple for setups like this.

In your case it would be significantly easier to use a multisite install using subdirectories rather than subdomains, then all of this would be taken care of for you automatically.

0

Well the solution was kind of easy. Usually in the wp_usermeta you have the usual information for all accounts (administrator settings).

wp_capabilities and wp_user_level Just needed to add the different prefix instead of the wp.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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