Block filter QUERY requests in robots.txt and htaccess

This topic has 4 replies, 2 voices, and was last updated 2 months ago ago by ziga32

  • Avatar: ziga32
    ziga32
    Participant
    October 5, 2025 at 14:20

    My site is overcrawled with bots, as discussed here
    https://www.8theme.com/topic/site-crashing-due-to-fileers-being-attacked-by-bots/#post-456271

    my hosting suggest blocking filters in robots.txt file and/or .htaccess. hhey shared this general code for robots.txt

    User-agent: *
    Disallow: /*?*filter_*&filter_*
    Disallow: /*?*filter_*&*shop_view=
    Disallow: /*?*filter_*&*per_page=
    Disallow: /*?*filter_*&*query_type_*
    Disallow: /*?*query_type_*&*filter_*
    Disallow: /*?*min_price=
    Disallow: /*?*max_price=
    Disallow: /*?*add-to-cart=
    Disallow: /*?*add-to-wishlist=

    and this one for .htaccess
    # BEGIN – Block UA & QUERY requests for WooCommerce filters and add-to-cart

    RewriteEngine On
    # Specify UA (User Agent) – Googlebot hammer
    RewriteCond %{REQUEST_METHOD} ^(GET|POST)$
    RewriteCond %{HTTP_USER_AGENT} (Googlebot) [NC]
    # Specify patterns (QUERY_STRING) for filters and add-to-cart
    RewriteCond %{QUERY_STRING} (add-to-cart|filter_color|filter_size|filter_brand|min_price|max_price) [NC]
    # Return 429 and stop
    RewriteRule “^.*$” – [R=429,L]

    # END – Block UA & URL QUERY requests for WooCommerce filters and add-to-cart

    is this ok or do I need to adjust it for xstore?

    3 Answers
    Avatar: Andrew Mitchell
    Andrew Mitchell
    Support staff
    October 6, 2025 at 09:37

    Hello, ziga32,

    Yes, that is correct. This code will work for any theme.

    Best regards,
    8Theme Team

    Avatar: ziga32
    ziga32
    Participant
    October 6, 2025 at 09:43

    thank you

    Avatar: ziga32
    ziga32
    Participant
    October 6, 2025 at 09:43

    Thanks for the support! My topic “block filter QUERY requests in robots.txt and htaccess” has been successfully resolved.

  • Viewing 4 results - 1 through 4 (of 4 total)

The issue related to '‘block filter QUERY requests in robots.txt and htaccess’' has been successfully resolved, and the topic is now closed for further responses

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.