• TrishaM

    (@trisham)


    At least, I *think* they are bots…

    I use Relevanssi for indexing and in my user searches log I see that someone/bot has been visiting my site daily (multiple times) and searching using terms “index/thinktemplatedriverfile/write” and “/index/thinkapp/invokefunction”.

    I’d like to be able to keep bots from using my searchform, but allow real people to search.

    I’ve search for a solution but am only finding how to block bots from comments, user registration, etc…not from using my search form.

    Any suggestions? My guess would be that a solution would involve renaming my search form and/or parameters, but I’m not that familiar with it and don’t want to break anything, so clear instructions would be very appreciated!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Farhad

    (@farhadvn)

    You can use some features, as firewalls, for example block post methods that not inclusive http referer & http language accept, how ever you should save whole of your site not only search.

    I use a Cloudflare firewall rule to issue a JavaScript challenge …
    (http.request.full_uri contains “/?s=” and not
    http.referer contains “mysite.com” and not
    cf.client.bot)

    Farhad

    (@farhadvn)

    1. Disable /?s= in robots.txt by:

    User-agent: *
    Disallow: /?s=*

    2. Block by htaccess

    RewriteEngine on
    RewriteCond %{QUERY_STRING} (/?s=) [NC]
    RewriteCond %{HTTP_REFERER} !^https://(www\.)?bbb.com/.*$ [NC]
    RewriteRule .* - [F,L]

    Remember change bbb.com by your url (google.com for example)

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Block bot access to search form’ is closed to new replies.