Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

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.

share|improve this answer
    
I'm building an app in WordPress (and thus putting all functionality in the theme). Otherwise, I'm aware of the rsd_link action, but looking for clean way to switch off xml rpc. –  Omar Abid Jan 8 '13 at 23:43
    
There is no reason to build an app as theme, quite contrary it should be a plugin. You can use register_theme_directory() to add a custom theme from the directory of your plugin. –  toscho Jan 8 '13 at 23:47
    
I was going the plugin way, but found that using a Theme will help me avoid many headaches with register_theme_directory(), so I did it the easy way ;). –  Omar Abid Jan 8 '13 at 23:49
    
As you can see xmlrpc.php is out of reach for a theme. –  toscho Jan 8 '13 at 23:50
    
I thought the choice had to do with semantics. Does that mean that functions.php has some limitations? If so, where can I find these limitations? –  Omar Abid Jan 8 '13 at 23:54
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.