WordPress Snippets at WPcustoms

Disable Pingbacks for security reasons

Due to recent hacking attemps of WordPress sites we found a code to close the hole. This disables the blog pingback functionality most sites don’t even use and prevents WordPress from participating in pingback DOS-attacks.


/**
 * Snippet Name: Disable Pingbacks for security reasons
 * Snippet URL: http://www.wpcustoms.net/snippets/disable-pingbacks-for-security-reasons/
 */
 function remove_xmlrpc_pingback_ping( $methods ) {
   unset( $methods['pingback.ping'] );
   return $methods;
} ;
add_filter( 'xmlrpc_methods', 'remove_xmlrpc_pingback_ping' );