是的,我有这个问题。而且,如果您需要特殊的用户管理,则必须设置一个新的自主(单站点)WordPress 安装。
这就是多站点的工作方式。所有用户都自动包含subscribers在网络中的所有站点中。
从文章不要使用 WordPress 多站点:
如果您需要用户在不同的站点上,但不知道他们在网络上,请不要使用 MultiSite!现在,是的,有一些方法可以解决这个问题,但是对于任何大公司来说,这都是一场审计噩梦,并且在开始之前你应该意识到一个安全风险。
这个插件可能有帮助(但不确定):多站点用户管理。
从我最近在 WordPress StackExchange 上给出的答案中,一些小技巧可能会有所帮助:(
我在我的开发环境中做了一些小测试,但请进行广泛的测试)
/*
* Redirect users that are not members of the current blog to the home page,
* if they try to access the profile page or dashboard
* (which they could, as they have subscriber privileges)
* http://not-my-blog.example.com/wp-admin/profile.php
*/
add_action( 'admin_init', 'wpse_57206_admin_init' );
function wpse_57206_admin_init()
{
if( !is_user_member_of_blog() )
{
wp_redirect( home_url() );
exit();
}
}
/*
* Redirect users that are not members of the current blog to the home page,
* if they try to access the admin
* http://not-my-blog.example.com/wp-admin/
*/
add_action( 'admin_page_access_denied', 'wpse_57206_access_denied' );
function wpse_57206_access_denied()
{
wp_redirect( home_url() );
exit();
}
/*
* Redirect users that are not members of the current blog to the home page,
* if they try to login
* http://not-my-blog.example.com/wp-login.php
*/
add_filter( 'login_redirect', 'wpse_57206_login_redirect' );
function wpse_57206_login_redirect( $url )
{
global $user;
if ( !is_user_member_of_blog() )
{
$url = home_url();
}
return $url;
}
/*
* Hide the admin bar for users which are not members of the blog
*/
add_filter( 'show_admin_bar', 'wpse51831_hide_admin_bar' );
function wpse51831_hide_admin_bar( $bool )
{
if( !is_user_member_of_blog() )
{
$bool = false;
}
return $bool;
}