function block_wp_admin() {
if( is_admin()
&& !current_user_can( 'manage_options' )
&& !( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
wp_safe_redirect( home_url() );
exit();
}
}
add_action( 'admin_init', 'block_wp_admin' );
functions.php dosyasına ekleyin.