Using the following snippet you will be able to block admin for all users in WordPress.
1 2 3 4 5 6 7 | add_action( 'init', 'blockusers_wps_init' ); function blockusers_wps_init() { if ( is_admin() && ! current_user_can( 'administrator' ) ) { wp_redirect( home_url() ); exit; } } |
Snippet Source/Credit: WPSnipp