关注迷你日志公众号

Wordpress移除头部 wp-json 标签和 HTTP header 中的 link

Function代码

// 移除头部 wp-json 标签和 HTTP header 中的 link ,by minirizhi.com
remove_action('wp_head', 'rest_output_link_wp_head', 10 );
remove_action('template_redirect', 'rest_output_link_header', 11 );
remove_action( 'xmlrpc_rsd_apis',            'rest_output_rsd' );
remove_action( 'auth_cookie_malformed',      'rest_cookie_collect_status' );
remove_action( 'auth_cookie_expired',        'rest_cookie_collect_status' );
remove_action( 'auth_cookie_bad_username',   'rest_cookie_collect_status' );
remove_action( 'auth_cookie_bad_hash',       'rest_cookie_collect_status' );
remove_action( 'auth_cookie_valid',          'rest_cookie_collect_status' );
remove_filter( 'rest_authentication_errors', 'rest_cookie_check_errors', 100 );
文章目录
扫码了解详情