Restrict wp-admin access to subscribers

Adding this snippet to the functions.php of your wordpress theme will restrict wp-admin access to subscribers.

 

 

function restrict_access_admin_panel(){
global $current_user;
get_currentuserinfo();
if ($current_user->user_level <  4) {
wp_redirect( get_bloginfo('url') );
exit;
}
}
add_action('admin_init', 'restrict_access_admin_panel', 1);

Be Sociable, Share!

Leave a comment