xmlrpc_enabled filter not called

Since WordPress 3.5, the core developers have decided to keep xml rpc enabled by default and there are no options in the Admin to disable it.

This blog post explains how to disable it by modifying the xmlrpc_enabled filter

add_filter('xmlrpc_enabled', '__return_false');

But this doesn’t seem to work, I still get the following on the generated HTML

<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://domain.com/xmlrpc.php?rsd" />

and WordPress still generates the http://example.com/xmlrpc.php?rsd page

I’m putting the filter in the functions.php file of my theme.

1 Answer
1

To remove the HTML link:

remove_action( 'wp_head', 'rsd_link' );

To stop all requests to xmlrpc.php for RSD per XML-RPC:

if ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST ) )
    exit;

This is plugin territory. Never use this code in a theme.

Leave a Comment