Constantly getting hits on our site search catalogsearch url by what appear to be Chinese bots from mainly China, e.g.
/catalogsearch/result/?q=大奖娱乐88tb88手机版+Q82019309.com.com
I have blocked a lot of IP ranges for China, Russia and Ukraine. Some individual IP addresses are also blocked ** from other countries like **Germany.
The only one that seems to be active now is one that is supposed to be a GoogleBot, several in the 66.249.76.114
range.
Other than IP blocking, all I could think of was copying Data.php
to
/app/code/local/ from /app/code/core/Mage/CatalogSearch/Helper/
and changing the public function getQueryText()
to catch searches that had .com
in the string.
I changed the string randomly to something more befitting what the store sells using a small array of products. Only tested so far, see below!
if ($this->_queryText === null) {
$this->_queryText = '';
} elseif (strtolower(strpos($this->_queryText, '.com')) !== false) {
$botitems = Array("* product 1","* product 2","* product 3","* product 4","* product 5","* product 6","* product 7","* product 8","* product 9");
$this->_queryText = $botitems[rand(0, count($botitems) - 1)];
} else {
/* @var $stringHelper Mage_Core_Helper_String */
$stringHelper = Mage::helper('core/string');
Questions are:
- Is there any other way to stop bots using the search string?
- Will these hits cause any problems with site ranking?
- other than i.p. blocking is changing the search query when they hit a good or bad idea?
- Is the bot that looks like a Googlebot legit?
- What are they up to?
Thanks in advance for any help.