XML-RPC is a WordPress feature that allows external applications to communicate with your website. When you do not use XML-RPC functionality, you can disable it with a simple filter.
Steps
- Add the code below to your theme’s
functions.php. - Save the changes.
- WordPress will disable XML-RPC methods that depend on the
xmlrpc_enabledsetting.
/**
* Disable WordPress XML-RPC
*/
function custom_disable_xmlrpc( $enabled ) {
return false;
}
add_filter(
'xmlrpc_enabled',
'custom_disable_xmlrpc'
);
Tested on
WordPress 7.1
Reported by the author on September 24, 2026. WPFolks has not verified this.