Cameron
Cameron

Reputation: 28843

Multiple Wordpress installation sharing one user table

I have set up a couple of WordPress sites that all share the same user table (and login cookies), however as outlined in this article: http://hungred.com/how-to/multiple-wordpress-installation-sharing-user-table-touching-wordpress-core/ you get an error about not having permission to view the admin for the other sites because of the table prefix.

The problem is this article is rather old now and the code has changed in the capabilities.php file so I can't do the hack shown. BUT I don't want to hack the core code anyway. How can I fix this problem???? Needed asap please. Thanks

EDIT: I don't want to use the WP 3.0 Multisite stuff, as this is 3 separate websites, they just share cookies and users.

EDIT2:

The main site is at http://www.paperviewmagazine.com/ and I have it setup as MS, so that I can have different sites such as Community, Job Board, Marketplace etc. (you won't be able to access these sites by the way as they are in development and password protected)

I also have stand alone installations at http://blog.paperviewmagazine.com and http://help.paperviewmagazine.com these are currently using the cookie hash and user tables as the site at www.paperviewmagazine.com

The problem is that when visiting the /wp-admin/ of the Blog or Help site I get the error about permissions. Hopefully this clears up about how I'm using both MS and stand alone WordPress sites.

Upvotes: 1

Views: 3519

Answers (4)

Mike McLin
Mike McLin

Reputation: 3637

There are a couple methods to fix this issue. First, you could manually add the capabilities to the usermeta table (yuck). You could also, just have an administrator manually assign a role to each new user on each blog (also, yuck). The best solution I found is a plugin called WP-Orphanage Extended.

I created a video screencast explaining the whole issue, and showing how to use a single users table for multiple WordPress sites. You can find it here: http://mikemclin.net/single-users-table-multiple-wordpress-sites/

Hope this helps.

Upvotes: 0

Svetoslav Marinov
Svetoslav Marinov

Reputation: 1546

By using one install for everything makes it also a week link. If WP or a plugin crashes badly everything will go down.

Upvotes: 0

John P Bloch
John P Bloch

Reputation: 4591

Normally you would use a shared user table:

http://codex.wordpress.org/Editing_wp-config.php#Custom_User_and_Usermeta_Tables

For blog and help, use unique prefixes and define CUSTOM_USER_TABLE and CUSTOM_USER_META_TABLE in their wp-config.php files. For example, if the main site used site1 as its prefix, you would add this to wp-config.php:

define( 'CUSTOM_USER_TABLE', 'site1_users' );
define( 'CUSTOM_USER_META_TABLE', 'site1_usermeta' );

However, because one of the sites is a Multisite installation, that might screw things up. For example, I don't think the Super Admin role exists in single site installs, nor do a lot of those permissions. I hope this helps point you in the right direction.

EDIT

However, I do suggest just using MS for all sites. The only reason I could imagine not doing that would be if you want to use subdirectories in the main one but keep subdomains for blog and help. But still, I'd suggest using MS for the whole network.

Upvotes: 2

TheDeadMedic
TheDeadMedic

Reputation: 9997

Are they entirely separate domains? For example, example.com and another.com?

Or are they sub-domains or directories of one single domain, like one.example.com or example.com/two?

If the latter, why not use MultiSite? That's exactly what it was designed for!

Upvotes: 2

Related Questions