Deny dashboard access breaks ajax requests

You need to also check it’s not an AJAX request inside your hook:

if ( ! current_user_can( 'administrator' ) && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) {
    wp_redirect( home_url() );
}

techhipbettruvabetnorabahisbahis forumutaraftarium24eduedusedueduseduseduedusedusedusedus