115 Responses

  1. krishna
    krishna Published |

    great justin this was what i was searching for and u delivered it straight to my mail.

    thanks justin for sharing.

    Reply
  2. J Mehmett
    J Mehmett Published |

    Of course this is the easiest way to share tables, not only the users table but even if you run multi-lingual blog which are installed under different directories.

    Besides this is similar of how several web sites like Yahoo and MSN manage sessions across multiple domain names. For example if I logon Yahoo.com I can still remain logged in on flickr.com :D

    I assume if both domain names are on the same account or the database host is not “localhost”, sharing WP DB tables across domain names is easy, too.

    Thanks for sharing.

    Reply
  3. Natalie
    Natalie Published |

    Nice! Like what you said…and I like your name.

    My husband, “Justin” and I leave on September 30th to backpack to various countries around the world for a year or so. As we have been planning for our adventure we have been updating a blog. http://www.nomadbackpackers.com

    Justin and I both publish stories, etc. It seems like you’ve got a lot of experience with wordpress.

    Departure: in 8 days!!! We would love to have other opinions, ideas, encouragement, advice, helpful tips, and more left as comments.

    Thanks,
    Natalie

    Reply
  4. J Mehmett
    J Mehmett Published |

    Thats what I’m planning now. I’m going to build a website for a local TV and radio here. They wanted to run a multi-lingual site, and a separate sub-domain for the TV.

    So, I can make the site share several tables across all the installations. I’d go to WPMU, but I know, I don’t need that since what I need is only sharing tables.

    I assume two bbPress installation can share database resources, too, because, WP and bbPress can share the users and usermeta tables.

    Reply
  5. J Mehmett
    J Mehmett Published |

    That is interesting, I was really wondering about all the framework you have done to make ThemeHybrid running under several installations.

    Reply
  6. Nihar
    Nihar Published |

    Justin,

    I didn’t think that we could do something like this. sharing two tables user tables between two wp blogs.

    Thanks for the tip…

    Reply
  7. WordSkill
    WordSkill Published |

    So, could this be expanded to 4, 6, 20 installations?

    Thanks Justin.

    Reply
  8. jc min
    jc min Published |

    Justin have you tested other users besides the admin account using your code? if you did you probably noticed that you don’t have permissions regarding those newly created account if not kudos for you!.

    anyway have you figured out how to share user cookies across blogs so if you logon to one, you can be logged on the other?

    Reply
  9. #FN$#
    #FN$# Published |

    Hi! I’m new here!…
    Anyway, I wanted to have 3 blogs with the same users and I did follow your instructions. But when I created a new user to my main blog and I tried to log into any of the two others, I did logged into but I wasn’t able to reach the Dashboard. It justs shows the error: “You do not have sufficient permissions to access this page.”.
    What is wrong?… Any ideas??…

    Reply
    1. Mike McLin
      Mike McLin Published |

      Most people will run into permissions errors when they start using a single users table. That is because WordPress doesn’t handle the creation of user roles properly (or maybe it does, but it just isn’t the experience most of us would expect).

      Regardless, everyone having issues with permissions are suffering from what is called “orphaned roles.” It’s actually a pretty easy concept, and there is a plugin that’ll fix it for you too.

      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/

      Reply
  10. #FN$#
    #FN$# Published |

    Thanx for the help anyway. I read a lot of posts and I can’t figure this out… I may disable user registration…

    Reply
  11. Rui Zamith
    Rui Zamith Published |

    I have an important question: imagine that you have Blog A, and you create a Blog B. So, what you do is call the user database from Blog A when you’re installing Blog B. For now, all good!

    But is the information synchronized? For example, if a user registers on Blog B, will he be able to login in Blog A? Or else, do all the users need to register at Blog A in order to use the same login throught the network?

    Do you see what I mean? Well, even if it’s not synchronized, I guess that the solution will be to redirect the user always to the Blog A’s registration page, right?

    Thanks very much for the excellent post, simple and precise!

    Greetings,
    Rui Zamith

    Reply
  12. Rui Zamith
    Rui Zamith Published |

    Well, even if it wasn’t synchronized, it would still be extremely useful – at least, we could find a solution for it!

    In that case, it’s definitely an amazing and perfect solution for people like me that use several WP installations as single global website. You can even use bbpress has your forum tool, synchronize it with Blog A’s database, and totally centralizing your user info. Impressive!

    Thanks.

    Reply
  13. Dick Whyte
    Dick Whyte Published |

    Hi – I relaise this is probably a dumb question but I am planning on getting a web-site and I was wanting to run two wordpress blogs on it. Am I able to run two completely separate blogs by installing them separately?? The host I have has multiple MySql databases so if I create two and then install wordpress into two subdomains am I able to simply have two blogs?? Or do I need to do something like what you’ve done?? It seems very complex. I am a really really non-intelligent first time user and I really want to figure this out.

    Thanks for listening.

    Best,
    Dick Whyte

    Reply
  14. Cliff
    Cliff Published |

    Hi, Justin…

    Good stuff… I’m looking forward to trying this out this evening, as it’s been a goal of mine for a while now.

    I think that the commenters who ask about synchronization are concerned that their users would have to register at a ‘master’ site – Site A – in order to be universally registered with Site B, Site C, Site D, and so on. To RuiZamith’s point, that would still be better than having to register at each site individually, but not as nice as the reality you’ve enabled here, where I can register at Site C or Site D and still be registered for all of them.

    Synchronization implies an adjustment of two or more tables to match each other, so we should stop using that term here altogether. To abate the confusion that RZ and others might be experiencing, we should call your strategy ‘table sharing’, where there is only one users table shared by Site A, B, C, etc. , and let’s call the strategy RZ wonders about ‘table updating’, where the records from wp_users_A are regularly copied into wp_users_B, wp_users_C, etc. ‘Table updating’, if it were the only way to solve this problem, wouldn’t be completely ‘useless’, but let’s be glad that WP is better designed than that.

    Thanks again for a great solution to the problem, Justin! Bravo!

    Reply
  15. Davor
    Davor Published |

    set the COOKIEPATH to the root:

    in wp-config.php

    add this

    define(‘COOKIEPATH’, ‘/’);

    Reply
  16. Davor
    Davor Published |
    Reply
  17. Davor
    Davor Published |

    Have anybody try this plugin http://wp-hive.com/download/, i can not set it up

    Reply
  18. Brett
    Brett Published |

    I tried installing this with WP2.7 as per your instructions, but as soon as I add the lines:

    define(‘CUSTOM_USER_TABLE’, ‘wp_users’);
    define(‘CUSTOM_USER_META_TABLE’, ‘wp_usermeta’);

    I can no longer log into the second wordpress installation using admin. This (obviously?) is because that user “admin” was overwritten by the other admin. What I don’t get is why the other (original) admin has permissions to work within the new blog installation.

    Do you have any ideas?

    Thanks!
    Brett

    Reply
  19. Brett
    Brett Published |

    I found the solution on wordpress’ support site. This solution also keeps you logged in across sites. Scroll down to “Wolthers” comment.

    http://wordpress.org/support/topic/164758?replies=13

    Thanks for getting me started on the right track here :)

    Reply
  20. Brett
    Brett Published |

    Although it’s probably not worth going back on a functioning existing site, people may also be interested in wordpress MU (multi user install):

    http://mu.wordpress.org/

    Reply
  21. schikowski
    schikowski Published |

    Thank you for sharing this idea, Justin. It seems like a great workaround if someone doesn’t want to use WP MU.

    Cheers, schikowski

    Reply
  22. Borko
    Borko Published |

    Does anyone know how to share the cookies so you stay logged in?

    Reply
  23. Patrick DeVivo
    Patrick DeVivo Published |

    Hey Justin,
    This post was really useful for me, but do you know if by any chance it works when syncing the users in a standalone WP install with those of a WPMU install? I want members on my current WP install to be able to use their same account with a WPMU install. I’m trying to build a network using WP, WPMU, and bbPress. So far syncing WP and bbPress was pretty easy, but I’m unsure about WP and WPMU.

    Thanks,
    Patrick

    Reply
  24. Kate Mag
    Kate Mag Published |

    Wow, i never knew that was possible. Cool! Thank you, Justin

    Reply
  25. Didik
    Didik Published |

    Hi, Justin. I must say this post helps me a lot! But now I’m facing some problems:

    Let say Blog A and Blog B, whereas Blog B is using user data from Blog A. Blog A and B sharing a database (just like you suggested in this post, using custom prefix to define each one of them). Now what I would ask is:

    1. If user registering to Blog B, where will be the registered member database? Is it in A’s or in B’s?
    2. I wanted to write a post in Blog B but somehow can’t assign the author of my choice, meaning the author combo-box isn’t show up. What could be wrong?

    Thank you,
    Didik.

    Reply
  26. Ajay M
    Ajay M Published |

    I want to share the same user table with 4 wordpress blog.
    Any idea about how to proceed?
    I would like to reiterate that I have the old one with good user base present now and the other 3 are brand new and already installed.

    If u can throw some light I will be glad.

    Reply
  27. Ajay M
    Ajay M Published |

    Forgot to say that all my Wordpress are installed on completely different database…but they have save prefix wp_

    Reply
  28. Ajay M
    Ajay M Published |

    Thanks a lot Justin.

    Could you at least let me know if there will be any issues if I will operate 4 installation of Wp from same database? Like while taking back up and restoring them?

    Reply
  29. Ajay M
    Ajay M Published |

    Hurray…I did it…
    I took one of my existing Db and exported it and then renamed the prefix from prefix old to prefix new and then imported that to the existing primary DB for the old blog and now all seems fine.

    Thanks again for the help.

    Reply
  30. Borko
    Borko Published |

    No luck…. with adding this to my wp-config.php file

    Reply
  31. Jeremiah Lewis
    Jeremiah Lewis Published |

    Great article! This actually helped me determine what I needed to do for a site I’m working on.

    How does one install 2 different instances of WP on one site? Is this a matter of installing the second WP to a subdomain/subdirectory?

    Reply
  32. Ajay M
    Ajay M Published |

    All seems fine except users has to log n individually in each blogs. Any workaround for that?

    Reply
  33. Sumit
    Sumit Published |

    thanks for this article.

    BUt i found a lot of crazy things in the comments here. There is NO SYNCHRONISATION between anything! The installations share THE SAME DATABASE! So if you register in blog a or blog b it will be written in the database that the Blogs share! And that causes you can log in in both blogs. There is just nothing to synchro… Thats the good point ;-)

    Reply
  34. study
    study Published |

    I don´t speak english but I understand code. You are my hero. thanks

    Reply
  35. jo
    jo Published |

    thanks a million
    after searching for a few hours, your two lines saved my day :)

    Reply
  36. Nigel
    Nigel Published |

    Thank you very much, those two lines did exactly what I needed.

    Reply
  37. Dave
    Dave Published |

    Thanks i was looking for that, i have read a lot a blogs vut they where so freeaking techical, but this was easy to follow for a code n00b like me :)

    Thanks mate.

    Dave

    Reply
  38. ZoltakSmash! News » Small Victories
    ZoltakSmash! News » Small Victories at |
  39. ilan sitesi
    ilan sitesi Published |

    thank you for very useful tips and good idea. that’s what i need in my classified site. i will use this tip. thanks.

    Unnecessary link removed by the administrator. There is an input field for a link to your site.

    Reply
  40. Sumit
    Sumit Published |

    oh i got a question about this:

    are the user permissions written in the user_table too ?
    Because i want different permissions for the users in the different blogs. Is that possible or do they automatically have the same permissions?

    Reply
  41. Drey
    Drey Published |

    Same issue as Sumit here! I’m using your technique for sharing user tables, but it seems to mess up if using different Roles in the different blogs… any idea how to solve? I’m using Role Manager plugin, and when I try to call the list of the profiles of custom roles, it throws “Warning: array_keys() [function.array-keys]: The first argument should be an array in… on line…” (on that line of the template file it has a ” $user->role = array_keys($user->$role); // assign ‘role’ property to $user”… i know it might be a long shot to ask for help here but… any idea on how to solve it?
    Thanks in advance!

    Reply
  42. Kim
    Kim Published |

    Thanks for the tutorial Justin. I’m working with setting up 2 WordPress blogs now (both 2.7.1), one in the root and one in a subdirectory, and wanted to share the same users across both.

    I’ve followed your instructions, and some pointers from the comments, including the suggestions in Wolther’s post in this thread from the wordpress.org forum: http://wordpress.org/support/topic/164758?replies=13

    With only including the defines for the user and usermeta tables and the cookies in the 2nd install’s config file, I am unable to login to the second blog. I had to include the following (define(‘CUSTOM_CAPABILITIES_PREFIX’, ‘wp_’);) in the config file and make the change to wp-includes/capabilities.php to be able to log into the second blog.

    Like others, I don’t like having to modify a core file to get something working. Is there any way to create a plugin using the changed code for wp-includes/capabilities.php so that it will override the existing core code? It doesn’t look like the devs want to commit it to the core, from what I read in a couple of Trac tickets.

    Thanks in advance for any help you can provide. :)

    Reply
  43. Kim
    Kim Published |

    Thanks Justin, I appreciate it. :)

    Reply
  44. prince
    prince Published |

    Hi there,

    I am registering a User with an “Editor” role in Blog A, and when I look at Blog B, the Role is set to “None” instead of “Editor”.

    I’m using memberwing plugin too… When I register a user on a “Certain Role Level” on blog A, it appears as Role: “None” to blog B.
    (and vice versa)

    Please help.
    Thanks

    Reply
  45. jan
    jan Published |

    You gotta be kidding me! And two and a half years later, here I am at a two lines solution, having designed 2 plugins to do the same. I thought I was smarter than this. You my man…

    Reply
  46. Stephen R
    Stephen R Published |

    Anyone using this technique might also be interested in the wp-orphanage plugin: http://xentek.net/code/wordpress/plugins/wp-orphanage/

    What this does is — any time WP encounters a user without any privileges, it automatically makes them a subscriber.

    Reply
  47. Elizabeth K. Barone
    Elizabeth K. Barone Published |

    I wish I’d found this a while ago! Are the user roles the same in both blogs? What if you want someone to be an Author for one blog and a Subscriber for the other?

    Reply
    1. David Riveroll
      David Riveroll Published |

      I really don’t know if this will work, cause I’m kinda a beginner in WP. But I’d try to share only
      define(‘CUSTOM_USER_TABLE’, ‘wp_users’);

      and not
      define(‘CUSTOM_USER_META_TABLE’, ‘wp_usermeta’);

      because this is were the capabilities are set, but as I said, I don’t know if that would mess with something and I haven’t tried it yet.

      Reply
      1. Bob
        Bob Published |

        David,

        You do want to xx_usermeta defined that way precisely so that all the different user caps will be maintained in the same place.

        Each WP instance will properly maintain the user caps in the user meta table, each using their assign table prefix… no conflict there…

        Saludos,
        Bob

  48. David
    David Published |

    Elizabeth, I think they’d need to be the same role, because it’s just one database table that stores the info for both blogs….

    @topic. I really wish one day the Wordpress people could figure out a way of allowing for this kind of thing by default, without having to screw around with files, etc..

    Reply
  49. jcwynford
    jcwynford Published |

    hi! Just wondered if you also tried sharing user table between a main wordpress and a wordpress MU? I need some help for this, thanks!

    Reply
  50. EMG
    EMG Published |

    Hey there Justin!

    I wish I had come across this post of yours when I had been reading up on your sidebars discussion and user control over themes discussion!

    I thought I would give you an update on this method of sharing user tables and let you know that I followed your instructions for sharing a user table between two WP installs, both version 2.8.2 (within the same database, made sure all the prefixes were done correctly, and added the appropriate lines in my configuration file) and I received a permissions error.

    I went to the WP thread you linked to and read up on the discussion and found that other users had similar permissions errors and so I additionally altered the core capabilities file as well as per instructions.

    Maybe it’s just 2.8.X or something, but I am still getting permissions errors.

    It does seem like the user tables ARE shared as I only get errors associated with the logins associated with my main account and it seems like everything ELSE about the install is fine. I just can’t get rid of my permissions errors.

    Creating a new account post user-table linking on my primary account and trying to log into my secondary WP install also brings up the error.

    I’m not sure if you’ve run into any such errors yourself or if anyone else has tried it for 2.8, but these are the errors I’m running into myself and so I figured I’d share.

    Thanks for all of your posts; the content and resulting discussions are awesome!

    Reply
  51. Laura
    Laura Published |

    I thought this couldn’t be done. Thank you (again!) for your insight into this.

    Reply
  52. Ah John
    Ah John Published |

    Thanks Justin for the excellent tutorial!

    I have a question about the SEO for 2 blogs within 1 domain.

    I’ve installed 2 separate WordPress copies for the English version and the Chinese version, under /ahjohn_en and /ahjohn_cn directories respectively. When the user reaches http://www.ahjohn.ca, the top index.php redirects them to either http://www.ahjohn.ca/ahjohn_en or http://www.ahjohn.ca/ahjohn_cn according to their last choice stored in the “cookie”. I also have 2 separate sitemap.xml files under ahjohn_en and ahjohn_cn, but have no top sitemap.xml under for the entire website.

    My question is: how can I let the search engines know or find all of the contents and traffics from each blog as a “whole” report for the entire website “ahjohn.ca”?

    Am I on the right track? What should I do to reach my goal?

    Please help me out. I really appreciate it!

    Reply
  53. Ah John
    Ah John Published |

    (sorry, the < and > were NOT displayed in the previous comment. re-submitting it)

    Thanks Justin for the excellent tutorial!

    I have a question about the SEO for 2 blogs within 1 domain.

    I’ve installed 2 separate WordPress copies for the English version and the Chinese version, under <hosting-root>/ahjohn_en and <hosting-root>/ahjohn_cn directories respectively. When the user reaches http://www.ahjohn.ca, the top index.php redirects them to either http://www.ahjohn.ca/ahjohn_en or http://www.ahjohn.ca/ahjohn_cn according to their last choice stored in the “cookie”. I also have 2 separate sitemap.xml files under ahjohn_en and ahjohn_cn, but have no top sitemap.xml under <hosting-root> for the entire website.

    My question is: how can I let the search engines know or find all of the contents and traffics from each blog as a “whole” report for the entire website “ahjohn.ca”?

    Am I on the right track? What should I do to reach my goal?

    Please help me out. I really appreciate it!

    Reply
  54. Jesper
    Jesper Published |

    Well, i have used this for a while now but i have always had the same problem, when a user register at blog A, he get the appropriate roles, but on blog B he´s roll is set to None and i manually have to set user roles!

    Any solution to this without using any plugins?

    Reply
  55. brandon
    brandon Published |

    how do i add a second blog to an existing blog and database?
    i wanted my main blog for my website news, a second for a current project im doing, and a third for my girlfriend and i to record the times with our dog.

    is there a benefit to having the same user name and info from one blog for all of them?
    or cant i just install 3 wordpress databases/blogs and make all the logins the same for all the 3?

    Reply
  56. Ed
    Ed Published |

    Everything was working perfectly until I upgraded my blogs to WP version 2.8.4 recently. Is anyone out there experiencing similar issue? Better yet, does anyone know how to resolve the issue? I checked the wp-config.php on all of my blogs and they were left intact during the upgrade….

    Reply
  57. Sharing users across multiple WordPress installations | Frank P. Walentynowicz
  58. samson
    samson Published |

    i have 2 wp blogs (main and sub domain) so, i want them to share a wedgets is there any one helping me…?

    Reply
  59. Frank P. Walentynowicz
    Frank P. Walentynowicz Published |

    Ed – I think you forgot to reapply changes to capabilities.php file after the upgrade.

    Reply
  60. Raize
    Raize Published |

    Worked perfectly with 2.9

    thanks

    Reply
  61. Brooks
    Brooks Published |

    I am using 2.8.6 and am having a similar permissions problem when logging into my secondary blog.

    These are the pieces of code I have added:

    in wp-config.php:

    define('CUSTOM_CAPABILITIES_PREFIX', 'wp_');

    in wp-includes/capabilities.php:
    replaced:

    $this->cap_key = $wpdb->prefix . 'capabilities';

    with:

    if (defined ('CUSTOM_CAPABILITIES_PREFIX')) {
    	$this->cap_key = CUSTOM_CAPABILITIES_PREFIX . 'capabilities';
    	}
    	else {	$this->cap_key = $wpdb->prefix . 'capabilities';
    	}

    Does anyone know if this code still works with 2.8.6 or is there another fix? Basically, if I can’t get this to work, I am locked out of my admin for my secondary blog.

    Reply
  62. RROD
    RROD Published |

    So this trick is so that you can login with the same username and password on 2 different blogs? Is this correct? From 2 different domains or the same domain?

    Reply
  63. alan
    alan Published |

    anyone gotten 2.9.2 to work with single wp_users on two different domain names .eg siteA.com siteB.com, both running on the same VPS.

    I’ve tried all the guides and threads you can find and the child site refuses to work and gets permission error. sigh…

    Reply
  64. Brina
    Brina Published |

    Can anybody give me an example of what I need to write in the config.php file if i wanted to share posts between 2 installs tah are using different tables on the same database?

    Thanks

    Reply
  65. nanu
    nanu Published |

    hii I tried using it but it shows an error called ” Cheatin’ uh?” when ever I try to login in the B blog using the user name and pass word.. Any idea would be really help ful

    Thanks
    Nanu

    Reply
  66. Aricu
    Aricu Published |

    Thanks a whole lot I applied the changes and it worked like a charm.

    Thank you.

    Reply
  67. Margarida Fernandes
    Margarida Fernandes Published |

    Hi,
    I was just wondering if this could be possible when I found your post.
    But I still don’t understand how this works.
    I have my WP blog installed with a data base (wp_) and now I am creating a site that is related to this blog, so I want the users to have the same access and previleges.
    But should I create the new site installation with the same database? That will probably give my new site all my current pages and posts from the blog, and I don’t want that. I just want to share users.
    Do I install the new site with a new database? Installing it using the same database will probably change my blog url and info, and destroy my old blog, right?
    Can you explain a little better how to implement this?
    Thanks

    Reply
  68. Mitchell
    Mitchell Published |

    I have two copies of WP installed, one under a sub-domain. All of the files are in another folder used for the sub-domain. I used a separate table prefix for the second site. For some reason this copy of WP won’t upgrade and I can’t install any plugins.

    If I do an automatic install to install a new plugin, the plugin ends up in the plugins directory of the WP copy on the main domain!

    How can I fix this?

    Reply
  69. Jack
    Jack Published |

    Thanks for sharing..

    By the way, I used this on a WP 2.9.2 blog and it worked perfectly

    Reply
  70. metaboy
    metaboy Published |

    Has anyone figured out a way to have different permissions for users on each blog? I would like to let a person be an author on one, but not the author.

    Reply
  71. ryanve
    ryanve Published |

    This technique looks like a great K.I.S.S. solution so definitely thank you for sharing it. Do you think now that WPMU is available, that’d be better for accomplishing this in the long run? I’m trying to run 3–4 top-level domains (not subdomains) all with the Hybrid framework. The possibility of only having to update one WP installation seems like a real time-saver. I’d really appreciate opinions on this. Thanks!

    Reply
  72. Antonio
    Antonio Published |

    Nice tip – thanks for sharing.

    How about this scenario;

    When I add a new blog post to site A, can I get it to also display on site B? Basically sharing the database again – but stops me having to update two databases.

    For example this would be necessary when a company has two product catalogue sites, and similar products.

    Doable?

    Reply
  73. Gavin
    Gavin Published |

    This works great, except for one small thing I have searched and searched for the solution to – Why can I not change the Posted by names on any of the other sites? When I try to change it, or anyone with editor or admin access writes a post on my three offshoot sites it only will display my name. What is the fix for this?

    Reply
  74. Mark
    Mark Published |

    Thanks Justin. Interesting.

    But I came across this post looking for a similar solution to a different problem. Maybe you can help. Essentially, I need two site (.com and .mobi, or maybe it’s .com and a sub-domain). Regardless, I want to share the blog posts across both sites but allow for separate pages for site. Actually, the page might be the same but I’m presuming I’d be trimming down the smartphone site to keep it clean and tight.

    Do you have any thoughts on this matter? Would it be too much to email me?

    Reply
  75. Nick Allain
    Nick Allain Published |

    @Mark – might be a little late but you could use a plugin to read the RSS feed of one site and repost the content.

    Reply
  76. hg
    hg Published |

    It doesn’t seem to work for 3.2.1 — I get an error (“You do not have sufficient permissions to access this page.”) when logging in on blog b (the one whose wp-config.php was edited).

    Reply
    1. hg
      hg Published |

      Replying to myself, I found the fix for 3.2.1 in the wp support blog:

      Change to wp-includes/wp-capabilities.php
      Find the line:
      $this->cap_key = $wpdb->prefix . ‘capabilities';
      Change it too:
      $this->cap_key = ‘wp_capabilities’;

      Reply
      1. Sven
        Sven Published |

        hg, I did ass you said, but I still get the error (“You do not have sufficient permissions to access this page.”) when logging in on blog b.
        Did you change only this?
        Or anyone else know what to do?

        Thanks

      2. anupal
        anupal Published |

        am too getting this error for permissions. did all but no still not working. i did all these changes in my Blog B core file (config.php, capabilities.php)
        Please help !!

  77. anupal
    anupal Published |

    great i was searching for it .. thanxx :)

    Reply
  78. chitranjan
    chitranjan Published |

    i am having this same problem and i am using WordPress 3.2.1. I tried by editing the config file but when i tried to edit the capabilities.php there is nothing like $this->cap_key = $wpdb->prefix . ‘capabilities’; need help please help .

    Reply
  79. Installing two WordPress blogs with the same users | MARVELTI
  80. Matty
    Matty Published |

    If suppose i have installed two blogs using two different database with same prefix wp…. then i want to use the same user login for both bloig.. how it would be possible? please let me know..

    Reply
  81. aditya
    aditya Published |

    plz help..i need similar codes like this

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

    for wp_post, wp_comments and all other tables except wp_options..
    basically i want 2 wordpress installations, both of which should use same tables except wp_options..that is, 2nd wp installation should use wp2_options and rest all tables having prefix wp_ please help…Thanks

    Reply
  82. Behind the Site: Mojo Themes, a WordPress theme marketplace | WPCandy
  83. rei
    rei Published |

    thanks! this is what im looking for! :) i hope this technique will work for the latest version of WP

    Reply
  84. Thomas
    Thomas Published |

    From the newest wordpress version this is the right code:

    define('CUSTOM_USER_TABLE', 'wp_users');
    define('CUSTOM_USERMETA_TABLE', 'wp_usermeta');
    Reply
  85. Sharing data between two wordpress installs
  86. Hakan
    Hakan Published |

    Hi,
    If somebody want to register blog B, thi registration saved on blog A db or blog B db ? I mean, blog B can use blog A table. Can blog B users register on blog A ?

    Reply
  87. Chandra
    Chandra Published |

    thanks,

    How do i get common login for two separate wp databases with different domain names in same host.

    Reply
  88. Vandna
    Vandna Published |

    Hi friends,

    I am also looking for the same solution, actually I have 3 sites and I am using subdomains, so is it possible to work with three sites.
    I am not an advanced user I found that this is an old post too. Can we use this with wordpress 3.5.1 .

    Any help will be appreciated.

    Reply
  89. onafets
    onafets Published |

    Hy Justin,
    I am not sure to have understood very well.

    In order to get users of the blog A into blog B, I have to match the blog A table in the blog B, right?

    blog A:
    $table_prefix = ‘bloga_';

    blog B:
    $table_prefix = ‘bloga_';

    define(‘CUSTOM_USER_TABLE’, ‘wp_users’);
    define(‘CUSTOM_USER_META_TABLE’, ‘wp_usermeta’);

    Reply
    1. onafets
      onafets Published |

      sorry I think I got it.

      I have got blog A
      $table_prefix = ‘wp_5’;

      so,
      blog B:
      $table_prefix = ‘wp_6;

      define(‘CUSTOM_USER_TABLE’, ‘wp_5users’);
      define(‘CUSTOM_USER_META_TABLE’, ‘wp_5usermeta’);

      Is it right?
      After this I should be start to see the users blog A appearing in the blog B too?

      Reply
  90. rexa
    rexa Published |

    So, could this be expanded to 4, 6, 20 installations?

    Thanks Justin.

    Reply
  91. Dos Blogs WordPress con los mismos usuarios | Creatuweb
  92. Tarik Massac
    Tarik Massac Published |

    Could just be me, but this isn’t working on my local install, every time I load up the secondary blog and run the wp-install page, it keeps telling me “please enter a valid username” but the username field says User(s) already exist” so I can’t add anything.

    Reply
    1. chaoskaizer
      chaoskaizer Published |

      Yep, I can surely say it doesn’t work with 3.7+.

      Reply
  93. Pavan Kumar A R
    Pavan Kumar A R Published |

    Give

    $_POST[‘user_name’] = ‘username'; for second wp-config.php.

    i am not getting same post for both the blogs with a single database. any one has a idea on this, Please help.

    Thanks.

    Reply
  94. shareef
    shareef Published |

    Hi sir,

    I tried all steps given here and succeed for admin part. But i have one problem that is not solved. Problem is when I log in as a subscriber or visitor in http://www.bjs.oculusvisual.com(my first WP site) then i should also be logged in for http://www.demo.oculusvisual.com(my second WP site) that is not happening currently. What i want is session and or cookie sharing for these sub-domain for visitor. please guide me …

    Reply
  95. Single Signon for WordPress Sites | Sathya's Log

Leave a Reply

By submitting a comment here you grant this site a perpetual license to reproduce your words and name/Web site in attribution.

Please use your real name or a pseudonym (i.e., pen name, alias, nom de plume) when commenting. If you add your site name, company name, or something completely random, I'll likely change it to whatever I want.

css.php