query_vars['author']; if (is_numeric($author_id) && intval($author_id) > 0) { wp_redirect(home_url(), 301); exit; } } } //add_action('template_redirect', 'disable_author_redirect'); // make sure all is excecuted before all add_action('template_redirect', 'disable_author_redirect', -9999); /** * Disable REST-API for all users except of admin */ /** add_filter('rest_authentication_errors', function ($access) { if (!current_user_can('administrator')) { return new WP_Error('rest_cannot_access', 'Only authenticated users can access the REST API.', ['status' => rest_authorization_required_code()]); } return $access; }); */