title: Only administrator allow to access wp-admin and login?
body: <p>I would like to do that only administrator(role) allow to login with wp-admin not any other role, other uses like(editor,author) are login from front end and it's working fine but i would like only administrator can login through  wp-admin.</p>
  
  <p>I have used ultimate member plug in for front end login.
  <a href="https://wordpress.org/plugins/ultimate-member/" rel="nofollow">Ultimate Plugin link</a></p>
  
  <p>also i have used below code for access wp-admin only for administrator(role) but it's not working.</p>
  
  <pre><code>&lt;?php
  function restrict_admin(){
  //if not administrator, kill WordPress execution and provide a message
     if( !current_user_can('administrator') ) {
          wp_die( __('You are not allowed to access this part of the site') );
      }
  }
  add_action( 'admin_init', 'restrict_admin', 1 );
  ?&gt;
  </code></pre>