2016-10-01 55 views

回答

1

如薩格爾,在他的回答鏈接它,你可以用代碼做到這一點:

<?php 
add_filter('wp_headers', function($headers, $wp_query){ 
    if(isset($headers['X-Pingback'])){ 
     unset($headers['X-Pingback']); 
    } 
    return $headers; 
}, 11, 2); 
add_filter('pre_option_enable_xmlrpc', function($state){ 
    return '0'; 
}); 
add_action('wp', function(){ 
    remove_action('wp_head', 'rsd_link'); 
}, 9); 
add_filter('bloginfo_url', function($output, $property){ 
    return ($property == 'pingback_url') ? null : $output; 
}, 11, 2); 
add_action('xmlrpc_call', function($method){ 
    if($method != 'pingback.ping') return; 
    wp_die(
     'Pingback functionality is disabled on this Blog.', 
     'Pingback Disabled!', 
     array('response' => 403) 
    ); 
}); 
?> 

假如把它放在你的function.php文件。

或者你可以用a simple plugin來做,如果你不想編碼的話。