Disable xmlrpc Option for wp
xml-rpc is WP offline post protocol. If you are used to writing and publishing articles using Windows Live Writer, you must enable this feature. Otherwise, it is recommended that you turn it off to avoid security risks and give opportunities for Spam and Trackback Spam. In previous versions of wordpress 3.5, this feature can be turned on or off, but in the latest version it is turned on by default, and there is no option to turn it off in the background. So how do you turn this off? This can be done in two ways.
Add a sentence to the subject functions document:
add_filter(‘xmlrpc_enabled’, ‘__return_false’);
After that, turn off the XML-RPC functionality.
Just turn off xmL-RPC’s Pingback port without affecting third-party offline publishing:
add_filter( ‘xmlrpc_methods’, ‘remove_xmlrpc_pingback_ping’ );
function remove_xmlrpc_pingback_ping( $methods ) {
unset( $methods[‘pingback.ping’] );
return $methods;
}
The default theme does not disable this feature; an alternative is to use plug-ins to disable it.
本文系作者 @gong, ritchie 原创发布在 齐聚途遂。未经许可,禁止转载。