Skip to:
Content
Pages
Categories
Search
Top
Bottom

Stop users accessing /wp-admin

Viewing 3 replies - 1 through 3 (of 3 total)
  • Profile photo of imath
    imath
    Moderator

    @imath

    Hello,

    You can try to add this in the functions.php of your active theme :

    function henry_restrict_access_admin_panel(){
    global $current_user;
    get_currentuserinfo();
    if ( $current_user->user_level <  1 ) {
    
    $redirect = bp_core_get_user_domain( $current_user->ID );
    
    wp_redirect( $redirect );
    exit;
    }
    }
    add_action('admin_init', 'henry_restrict_access_admin_panel', 1);
    Profile photo of Hugo
    Hugo
    Moderator

    @hnla

    ? hmmm was going to post a variation on the above code but bp.org refuses it *shrug*

    Profile photo of shanebp
    shanebp
    Moderator

    @shanebp

    You already said that – aka – Stop hitting yourself

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Stop users accessing /wp-admin’ is closed to new replies.
Skip to toolbar