Mondoze Knowledge Base

Search our articles or browse by category below

How to Disable XML-RPC in WordPress

Last modified: March 16, 2021
You are here:
Estimated reading time: < 1 min

How to Disable XML-RPC in WordPress

All you have to do is paste the following code in a site-specific plugin:

add_filter(‘xmlrpc_enabled’, ‘__return_false‘);

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.

How to Disable WordPress XML-RPC with .htaccess

While the above solution is sufficient for many, it can still be resource intensive for sites that are getting attacked.

In those cases, you may want to disable all xmlrpc.php requests from the .htaccess file before the request is even passed onto WordPress.

Simply paste the following code in your .htaccess file:

# Block WordPress xmlrpc.php requests

order deny,allow
deny from all

Was this article helpful?
Dislike 0
Views: 60