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 thoughts on “Exclude Bot Hits from Counterize v2.0

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

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

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

這個網站採用 Akismet 服務減少垃圾留言。進一步瞭解 Akismet 如何處理網站訪客的留言資料