Para deshabilitar pingback y trackbacks, agregue este código a su archivo functions.php
en su tema secundario:
add_action( 'pre_ping', 'wpse_190346_internal_pingbacks' );
add_filter( 'wp_headers', 'wpse_190346_x_pingback' );
add_filter( 'bloginfo_url', 'wpse_190346_pingback_url' ;
add_filter( 'bloginfo', 'wpse_190346_pingback_url' ;
add_filter( 'xmlrpc_enabled', '__return_false' );
add_filter( 'xmlrpc_methods', 'wpse_190346_xmlrpc_methods' );
function wpse_190346_internal_pingbacks( &$links ) { // Disable internal pingbacks
foreach ( $links as $l => $link ) {
if ( 0 === strpos( $link, get_option( 'home' ) ) ) {
unset( $links[$l] );
}
}
}
function wpse_190346_x_pingback( $headers ) { // Disable x-pingback
unset( $headers['X-Pingback'] );
return $headers;
}
function wpse_190346_pingback_url( $output, $show ) { // Remove pingback URLs
if ( $show == 'pingback_url' ) $output = '';
return $output;
}
function wpse_190346_xmlrpc_methods( $methods ) { // Disable XML-RPC methods
unset( $methods['pingback.ping'] );
return $methods;
}
Alternativamente, puedes usar el complemento Disable Blogging que se encarga de deshabilitar el pingback / trackbacks para ti.