Skip to content

Instantly share code, notes, and snippets.

@nielslange
Last active February 18, 2017 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nielslange/53ea099a8d07f83b3c76a3e8da2091f4 to your computer and use it in GitHub Desktop.
Save nielslange/53ea099a8d07f83b3c76a3e8da2091f4 to your computer and use it in GitHub Desktop.
Disable XML-RPC Pingback
<?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