Last active
May 3, 2023 20:16
-
-
Save lukecav/c5fe896b1954ffcbfd7d8381de1c5bcc to your computer and use it in GitHub Desktop.
Disable pingback.ping xmlrpc method to prevent Wordpress from participating in DDoS attacks.
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 pingback.ping xmlrpc method to prevent WordPress from participating in DDoS attacks | |
// remove x-pingback HTTP header | |
add_filter('wp_headers', function($headers) { | |
unset($headers['X-Pingback']); | |
return $headers; | |
}); | |
// disable pingbacks | |
add_filter( 'xmlrpc_methods', function( $methods ) { | |
unset( $methods['pingback.ping'] ); | |
return $methods; | |
}); | |
add_filter( 'auto_update_translation', '__return_false' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment