We are continuously getting multiple spam search queries like this

大奖MG老虎机开户 Q82019309.com,

on my website. I don't understand what is this & how to stop this? Does anyone knows anything about it?


8 Answers 8


We're getting the same thing, currently looking into banning china/russia from our site as most malicious bots originate from there.

Edit: As a temporary measure, set "Maximum Query Length" to 15-20 depending on your catalog, its in System > Configuration > Catalog > Catalog > Catalog Search.

Edit#2: I resorted to IP Banning by GeoIP as shortening the query length didn't help. I chose https://www.mageworx.com/geo-lock-magento-extension.html - try blocking; China, Hong Kong, Taiwan, Singapore, Tibet.

Hope it helps

  • Tried it, but it still lets bots do the search, partial spammy link shows in admin panel... these bots crawl from dynamic IP's, tried banning range wise.
    – Icon
    Jan 9, 2017 at 5:00
  • 1
    Edited the comment again, hope it helps Jan 9, 2017 at 11:53

done some digging and identified its 360spider who is sending these spam searches - I found their user-agent in access_logs and they tend to search for q820... or www.qpyl etc

To block them (tested and works) - add the following to robots.txt

User-agent: 360Spider
Disallow: /

EDIT: I then noticed they spoofed the googlebot to perform the searches and I had to add the following to my robot.txt

User-agent: Googlebot
Disallow: /catalogsearch/
  • I'd be very careful about banning Googlebot via your robots.txt, this will literally cause Google to stop crawling the pages you disallow which will practically remove your store from Google searches. The odds are that if someone is spoofing to be the Googlebot, they won't care about your robots.txt either way. It's a text file, not some sort of web crawler cyber police.
    – TiEul
    Jan 30, 2017 at 22:26

The same bot is hitting our website, and I am seeing the search terms in our admin. We are currently disallowing the /catalogsearch/ and /catalogsearch/result/ so that they are not crawled and indexed. We also went into Google Search Console to remove the indexed URLs from these spammy queries.

We had our developer block certain query strings that had identifiable spammy strings as shown in the following block:

RewriteEngine on
RewriteCond %{QUERY_STRING} Q82019309\.com$ [NC]
RewriteRule .* - [F,L]

This isn't a long term solution though, as you would have to continue to add new spam queries.

Also, here is a link to another thread that discusses this issue:



The Magento catalog search spammers do not usually execute the search on your site - they do initially then post it as a link on another site so the ones executing those queries on your site are usually search engines following the link from some other site. If you block the IP you are blocking a search engine IP.

## Catalog Search Spam Stop

RewriteCond %{REQUEST_URI} catalogsearch/result/
RewriteCond %{QUERY_STRING} (\.|\%28|\%22)
RewriteRule ^(.*)$ - [F,L]

The above will work with Magneto 1. If you have Magneto 2 or other platform just adjust the Request URI to something appropriate.

The above will result in a 403 if a search containing a . or ( or " is executed or if anyone attempts to view it or if it's linked.

At least one of the above three characters is usually in the spam queries. Add more characters if needed.

You could redirect to your index but that would increase bandwidth and bounce rate. A 404 would also work but it would give search engines something to complain about so 403 it is.

Visitors and search engines will not be able to see or access the spam. However, don't forget to delete the old spam queries in the admin, the old spam would still be visible in search box as a suggestive term.

It also prevents new catalog search spam.


Facing a similar problem. I haven't deployed my changes but my plan of attack after doing some research is going to be as follows:

  1. Paradoxically, I am going to remove this line from my robots.txt file. Disallow: /catalogsearch/ as I want Google to find its way to this page.
  2. Create the following xml files in the correct spot under Magento_catalogSearch/layout/: catalogsearch_advanced_result.xml and catalogsearch_result_index.xml

With the following content:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <meta name="robots" content="NOINDEX,NOFOLLOW"/>

This will add the following meta tag to every page under: http://example.com/catalogsearch/result/?q=ABC

<meta name="robots" content="NOINDEX,NOFOLLOW"/>

I am also going to go into Google Search Console and manually remove the offending links.

I am not 100% sure if this will work and I will also be incorporating some other suggestions from this question.


Spam search queries are a form of abuse where spammers use your internal site search feature to create and advertise spammy content on your website. They may also link to these spammy search results from other low-quality websites, hoping to get more traffic and exposure

There are a few ways you can prevent and stop spam search queries on your website, such as:

• Use a firewall or a security extension that blocks malicious bots and requests, such as Cloudflare

• Use a captcha on your search form to prevent automated spamming attempts

• Use a blocklist to ban spammy IP addresses, user agents, or keywords from accessing or creating content on your website

• Use third party extension like Magento 2 Antispam Catalog Search or build your custom extension to prevent this happening


You can create a module that overrides the controller of the Magento catalog search controller. In that, you can check for non-English characters. If there is a non-English character you can redirect to the home page.

You can see more here http://dev-vibes.com/forum/topic/magento-prevent-spammy-search-terms


It's a known issue, basically spam search. Ignore. You really cant do much about it.

  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review Jan 9, 2017 at 4:36
  • Ignore is a solution. Just as other temporary methods: IP ban or Shorten Search query.
    – Icon
    Jan 9, 2017 at 4:51
  • Ok Thanks, I try with shorten search query & let`s see what will be the result. Jan 9, 2017 at 12:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.