Last active
February 18, 2017 14:16
-
-
Save nielslange/53ea099a8d07f83b3c76a3e8da2091f4 to your computer and use it in GitHub Desktop.
Disable XML-RPC Pingback
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
<?php | |
//* Remove X-Pingback header | |
add_filter( 'wp_headers', function( $headers ) { | |
unset( $headers['X-Pingback'] ); | |
return $headers; | |
}, 20); | |
//* Remove XML-RPC methods | |
add_filter( 'xmlrpc_methods', function( $methods ) { | |
unset( $methods['pingback.ping'] ); | |
unset( $methods['pingback.extensions.getPingbacks'] ); | |
return $methods; | |
}, 20); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment