Disable Pingbacks and Trackbacks
Closes pings on all content, removes the X-Pingback header and the XML-RPC pingback methods. Regular comments are not affected.
Opens WPIDE on
Code
add_filter( 'pings_open', '__return_false', 20 );
add_filter( 'wp_headers', function ( $headers ) {
unset( $headers['X-Pingback'] );
return $headers;
} );
add_filter( 'xmlrpc_methods', function ( $methods ) {
unset( $methods['pingback.ping'], $methods['pingback.extensions.getPingbacks'] );
return $methods;
} );
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.