workaround disabling xmlrpc from within wordpress mu-plugins file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Disable xmlrpc | |
*/ | |
if ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST ) { | |
include_once(ABSPATH . WPINC . '/class-IXR.php'); | |
class blocking_xmlrpc_server { | |
function serve_request() { | |
$response = new IXR_Error( 405, sprintf( __( 'XML-RPC services are disabled on this site.' ) ) ); | |
die( $response->getXml() ); | |
} | |
} | |
add_filter( 'wp_xmlrpc_server_class', function() { | |
return 'blocking_xmlrpc_server'; | |
}, 1000 ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment