admin管理员组文章数量:1122832
I have 2 wordpress websites on the same server, one is bloo and the other is forum.bloo. each site has its own database, they have their own wp_content, each has its own file separately, but I want the 2 sites to share the same user, if the user registers on bloo, he can connect to bloo. com and forum.bloo with the same login info.
As each site has separate files, is it possible for me to make the sites use the same wp_users and wp_usermeta, while the other tables will always be different from each website.
I only want the site to have wp_users and wp_usermeta in common. Basically, I want to create a user who registers on bloo or forum.bloo can connect to the 2 sites with a single account with this login info.
Please tell me how I can do this and if there is a code I should use please share it with me, thanks in advance.
I have 2 wordpress websites on the same server, one is bloo.com and the other is forum.bloo.com. each site has its own database, they have their own wp_content, each has its own file separately, but I want the 2 sites to share the same user, if the user registers on bloo.com, he can connect to bloo. com and forum.bloo.com with the same login info.
As each site has separate files, is it possible for me to make the sites use the same wp_users and wp_usermeta, while the other tables will always be different from each website.
I only want the site to have wp_users and wp_usermeta in common. Basically, I want to create a user who registers on bloo.com or forum.bloo.com can connect to the 2 sites with a single account with this login info.
Please tell me how I can do this and if there is a code I should use please share it with me, thanks in advance.
Share Improve this question asked May 20, 2024 at 8:24 MikeMike 1 1- 1 note that this is how multisite on a single install would have worked, with independent tables for each site all under the same install, but shared users/user meta – Tom J Nowell ♦ Commented May 20, 2024 at 9:13
1 Answer
Reset to default 1It is likely not worth the risk. A possible problem is that one site changes user data in a way the other site will not be able to understand, breaking it. So... the initial requirement for such a setting to work is that at least one of the sites do not change user data at all, maybe except for the bare minimum.
There is actually an old feature that allows to support the setup that you ask for by allowing you to specifically define which tables hold the user tables in which case the limitation is to have both sites using the same DB, but I have done small research and no one asked how to use this feature for a long while therefor I assume that not many use it in the wild.
Using multisite (as tom commented) is a better solution as it basically takes user management out of the site into a "common area", basically a user and meta table which are common for both sites as you asked for, but with an out of site control of the user. But even in such a setting you will be limited in how sites interact with the meta table and you will need to ensure that whatever plugins you use do not use the same meta keys for the values stored in the user meta table.
multisite also solve the problem of Single Sign On to both sites which I assume you will also want although not explictly specified in the question.
本文标签: multisiteHow to use 2 different databases but share the same user in wordpress
版权声明:本文标题:multisite - How to use 2 different databases but share the same user in wordpress 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736306599a1933017.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论