World Hunger Crisis

Exclude Bot Hits from Counterize v2.0

Oops, I’ve misunderstand the syntax of user agent tag. The following code can exclude most bot hits, with also Baidu search and Yahoo search.

if ( (stristr($useragent, “bot”) === TRUE) || (stristr($useragent, “spider”) === TRUE) || (stristr($useragent, “crawler”) === TRUE) || (stristr($useragent, “baidu”) === TRUE) || (stristr($useragent, “Yahoo! Slurp”) === TRUE) )
$checkval = TRUE;

So replace it with the old one. If you are new, add this below these two lines (around line 377) in wp-content/plugins/counterize.php:
$excludelist=get_option(’counterize_excluded’);
$checkval = strpos($excludelist, $remoteaddr);

Old version:
Exclude Bot Hits from Counterize

3 Responses to “Exclude Bot Hits from Counterize v2.0”


  1. 1 王小虎

    代码中的引号应为,而非

  2. 2 王小虎

    不好意思,请忽略以上留言。

    我发现这个留言系统总是把代码中的“单引号(ASCII为39)”转换成UTF-8里面的“文书单引号”。

  3. 3 思考/HK-X-Force

    我還是 PHP 新手呢,在 PHP 中使用單引號及雙引號不是一樣的嗎? @@”

Leave a Reply