WP for Wordpress

How to restrict wordpress users to access dashboard and Admins only



How would we restrict access to the WP admin area to all users except admins, The users on our site have their own profile pages which do all the functions they need. So admin should be off limits to all except admins. Put these lines in your functions.php function jm_no_admin_access()
{
if( !current_user_can( 'administrator' ) ) {
wp_redirect( home_url() );
die();
}
}
add_action( 'admin_init', 'jm_no_admin_access', 1 );


Responses

0 Respones to "How to restrict wordpress users to access dashboard and Admins only"

Post a Comment

AddThis

 

Recent Comments

Return to top of page Copyright © 2014