Blackhole for Bad Bots

Please post all questions and comments regarding Help & Manual 7 here.

Moderators: Alexander Halser, Tim Green

Post Reply
Paul Suderman
Posts: 33
Joined: Mon Dec 07, 2015 6:11 pm

Blackhole for Bad Bots

Unread post by Paul Suderman »

Hi!

I'm looking to add the code found at this site:

https://perishablepress.com/blackhole-bad-bots/

Here's the steps I need help with:
Step 3: Include the bot-check script by adding the following line to the top of your pages:

<?php include($_SERVER['DOCUMENT_ROOT'] . "/blackhole/blackhole.php"); ?>
The blackhole.php script checks the request IP against the blacklist data file. If a match is found, the request is blocked with a customizable message. See the source code for more information.

Step 4: Include a hidden link to the /blackhole/ directory in the footer of your pages:

<a style="display:none;" href="http://example.com/blackhole/" rel="nofollow">Do NOT follow this link or you will be banned from the site!</a>
This is the hidden link that bad bots will follow. It’s currently hidden with CSS, so 99% of visitors won’t ever see it. To hide the link from users without CSS, replace the anchor text with a transparent 1-pixel GIF image.
In step 3, do I include this line in the Page Template of the PPv3 responsive skin I'm using, and if so, in what section?
Image
My best guess is between line 173 and 174 in the defaultPageTemplate.html in the skin, but I'm too chicken to try it without some confirmation.

In step 4, I think I edit the _topicfooter.html file in the Baggage Files section of the skin, according to the help file. Could this be confirmed?

Thanks,

Paul
User avatar
Tim Green
Site Admin
Posts: 23181
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Blackhole for Bad Bots

Unread post by Tim Green »

Hi Paul,

Being cautious here was a good move: don't try to add the PHP include to the body of your page as you suggest! You should add it to the <head> </head> section at the top of the template (that's what the instructions meant but they weren't clear enough about it).

Also, for this include to work you are going to need to configure Apache to parse normal HTML pages for PHP, otherwise you will get an error. See here for details:

https://encodable.com/parse_html_files_as_php/
In step 4, I think I edit the _topicfooter.html file in the Baggage Files section of the skin, according to the help file. Could this be confirmed?
That will work, if you are including the footer. Otherwise you can also add it to the template, directly below the <%TOPIC_TEXT%> variable that inserts your content.
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
Tim Green
Site Admin
Posts: 23181
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Blackhole for Bad Bots

Unread post by Tim Green »

PS: Note that setting this up probably won't block the really bad bots. They are all smart enough to pose as good bots, so the real value of doing this is debatable. It will add to your site's overheads and bandwidth and may not really help in the places where you want to have its help the most.
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Paul Suderman
Posts: 33
Joined: Mon Dec 07, 2015 6:11 pm

Re: Blackhole for Bad Bots

Unread post by Paul Suderman »

Installed!

Thanks for your help, Tim. For the purpose of this project, ALL bots are bad bots. I want zero SEO here....

Paul
Post Reply