-1

I have a Wordpress Network with 3 sites. I want to know how can I restrict the user access in the subdomains. Actually, members of the principal site can login on the subdomains.

Do you know if a tiny plugin or a function can restrict users of just one single site ?

I have tried this, but still not work, or I don't know how to use it...

add_action( 'template_redirect', function() {

if ( ! is_user_member_of_blog() )   
    die( 'Please ask the network administrator to get access to this blog.' );
});

In wp-admin/network/site-users.php.

Can you help me ?

Thanks guys

  • 1
    please define "restrict" – Mark Kaplun Nov 5 '15 at 9:36
  • Are you modifying core files? – birgire Nov 5 '15 at 9:37
  • @MarkKaplun I mean, if an user logs on site2.com, instead he is member on site1.com, the account are not defined on the site... I don't know if it's possible. Am I clear ? – Nathan Meyer Nov 5 '15 at 9:39
  • @birgire No I have tried, but it doesn't work, so I have delete this code. – Nathan Meyer Nov 5 '15 at 9:41
  • just because a user is defined at site A doesn't mean he has any special access right in site B. If he does then you have done something wrong. So it is still not clear what you mean in "restrict", restrict what and when? – Mark Kaplun Nov 5 '15 at 9:46
-1

I hope this plugin is best for you. see https://wordpress.org/plugins/advanced-access-manager

You can also see the video tutorial for this plugin from this link. https://www.youtube.com/results?search_query=Advanced+Access+Manager

I hope it will help you.

  • Hi, thanks for your plugin. I have developed these websites, principally, around the Ultimate Member plugin... I know I can be dumb of maintain this plugin who make me crazy, but I took lots of time to develop this site, and if I can, I hope, I don't have to change the plugin by Advanced Access Manager. – Nathan Meyer Nov 5 '15 at 10:37

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.