Disable XML-RPC in WordPress 3.5
All you have to do is paste the following code in a site-specific plugin or your theme functions file:
Alternatively, you can just install the plugin called Disable XML-RPC. All you have to do is activate it. It does the exact same thing as the code above.