Disable REST API
Thu Jul 06 2023 12:03:21 GMT+0000 (Coordinated Universal Time)
Saved by
@gshailesh27
//Disable REST API
add_filter( 'rest_authentication_errors', 'wp_snippet_disable_rest_api' );
function wp_snippet_disable_rest_api( $access ) {
return new WP_Error( 'rest_disabled', __('The WordPress REST API has been disabled.'), array( 'status' => rest_authorization_required_code()));
}
content_copyCOPY
Comments