Hi , recently occurred brute force attack on my website , even I have log hiding plugin and limit attempt.
Today I run broken links test and there were problem with http://www.domain/xmlrpc.php 404 error
After some readings I decided to disable xmlrpc.php
But now there are pingback link that leading to xmlrpc.php and 403 error occur
two dead links xmlrpc.php?rsd and xmlrpc.php
How can I disable this line in Head.php
<link real=”pingback” href=”www.maindomain/xmlrpc.php”> == $0
Thank you
edit:
I added this code to function.php
I’m not to sure if this is best option but is working :
if (!is_admin()) {
function link_rel_buffer_callback($buffer) {
$buffer = preg_replace(‘/(<link.*?rel=(“|\’)pingback(“|\’).*?href=(“|\’)(.*?)(“|\’)(.*?)?\/?>|<link.*?href=(“|\’)(.*?)(“|\’).*?rel=(“|\’)pingback(“|\’)(.*?)?\/?>)/i’, ”, $buffer);
return $buffer;
}
function link_rel_buffer_start() {
ob_start(“link_rel_buffer_callback”);
}
function link_rel_buffer_end() {
ob_flush();
}
add_action(‘template_redirect’, ‘link_rel_buffer_start’, -1);
add_action(‘get_header’, ‘link_rel_buffer_start’);
add_action(‘wp_head’, ‘link_rel_buffer_end’, 999);
}
// Remove rsd_link from filters- link rel=”EditURI”
add_action(‘wp’, function(){
remove_action(‘wp_head’, ‘rsd_link’);
}, 9);
Hey digaluk,
Glad you got it working for you and thank you for sharing! :)
If you need further assistance please let us know.
Best regards,
Victoria