Protect your WordPress blog from the backup copies on the telegraph

To avoid that the articles are copied by the bot @chotamreaderbot and @corsabot

Who doesn’t love @chotamreaderbot and @corsabot? Two fantastic bot on the Telegram which, thanks to the excuse of the creation of the instant view of the items, thanks to a copy-on-telegra.ph, allows to the clever web of use it to be able to read the articles of the blog without giving to the same blog numbers on the visits.

I understand the thinking of people who hates any kind of script anti-tracking, but I also understand those who have a blog and want to defend themselves from this practice.

The solution is as simple as immediate.

Just enter inside the file functions.php our theme the following code

// by Francesco for www.selectallfromdual.com
add_action('parse_query','fuck_bot_telegraph');
function fuck_bot_telegraph() {
       if ( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) ) {
              //check ip from share internet
              $ip = $_SERVER['HTTP_CLIENT_IP'];
       } elseif ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
              //to check ip is pass from proxy
              $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
       } else {
              $ip = $_SERVER['REMOTE_ADDR'];
       }

       if (($ip == '54.205.5.19') || ($ip == '18.206.222.70')) {
              wp_redirect("https://it.wikipedia.org/wiki/Diritto_d'autore");
       } 
}

that part of the fun of the descriptions used, allows you to redirect services used by the two bots on other sources that are not in our blog, in order to avoid being copied.

Of course, the ip 54.205.5.19 and 18.206.222.70 are those from which the read request on our server, and in the case where return to work would mean that their ip will be changed, and at that point just re-identify them to update the script.

I hope I was useful for writing a useful plugin for WordPress.

Offrimi un caffè su ko-fi.com
We randomly check the functioning of the links in our articles. In the meantime, if any links are corrupt, please let us know in the comments, we will correct them. Thanks.

Francesco

Founder and CEO of Dummy-X since 2007, I share interests, ideas, projects, and IT solutions. I do not sell products, I limit myself to describing technologies and making available the right tools to realize ideas. Everything I write is the result of my work experience and my desire to learn. I have always been studying computer science in all its angles (software, hardware, networks and security) and in recent years I have specialized in the development of web applications. I am always open to new challenges and to research and knowledge of new technologies.
 

Leave a Reply

Your email address will not be published. Required fields are marked *