Jump to content
TNG Community

'Hide' robot visits on showlog.php


jimflack

Recommended Posts

I get a lot of spider visits (thats good) shown at My FlackGenealogy site.

I see on a couple of other discussion pages how to STOP the robots visiting (I dont want that) - but is there a way just to not show their visits - so I can see what real people are visiting.

Any help appreciated.

Jim Flack

Link to comment
Share on other sites

An easy way would be to replace a single line of code in showlog.php


echo "$line<br/>\n";
with the following

if (!preg_match('/(googlebot|crawl)/', $line, $match))
{
  echo "$line<br/>\n";
}

where you separate each bot with | that means OR. So this statement says, if you find "googlebot" or "crawl" in the string then don't print it. You may add as many bots as you like. If the number becomes too large then I would create a database table to handle it; if the number is small just do it like this. Be sure to document this change outside of this file since it may be overwritten when TNG releases an update.

Link to comment
Share on other sites

I see on a couple of other discussion pages how to STOP the robots visiting (I don't want that) - but is there a way just to not show their visits - so I can see what real people are visiting.
Jim,

Yes.

Go to Administration/Setup/Log Settings and enter the host names you want to exclude FROM APPEARING ON THE LOG in "Exclude Host Names." The spiders, bots, whatever, will continue to be able to visit your website; they just will not appear on your logs.

Arnold

+++++++++++++++++++++++

The TNG help file states this:

Exclude Host Names

Before making any log entry, TNG will check this list. If the host of the visitor responsible for the potential log entry is on the list, no log entry will be made. Host names should be separated by commas (no spaces) and can consist of entire host names, IP addresses, or portions of either. For example, "googlebot" will block "crawler4.googlebot.com".

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...