Skip to content

Instantly share code, notes, and snippets.

@lukecav
Last active May 3, 2023 20:16
Show Gist options
  • Save lukecav/c5fe896b1954ffcbfd7d8381de1c5bcc to your computer and use it in GitHub Desktop.
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.
// 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