Remove XML-RPC when not in use for performance boost

Disabling XML-RPC on WordPress has a few advantages, speed and security. If you don’t use XML-RPC, get rid of it for  a faster, more secure WordPress install.

1. This will remove the XML-RPC HTML code.

 
add_filter( 'xmlrpc_enabled', '__return_false' );

2. You’ll also need remove the X-Pingback from the response headers too

add_filter( 'wp_headers', 'yourprefix_remove_x_pingback' );
function yourprefix_remove_x_pingback($headers){
    unset( $headers['X-Pingback'] );
    return $headers;
}

Author: Kieran Barnes

Kieran is a PHP developer with 15 years commercial experience. Specialist in WordPress, CakePHP, CubeCart and all things PHP.

Leave a Reply

Your email address will not be published. Required fields are marked *