Documentation
ScraperBlock
Htaccess Blocking

Htaccess Blocking

When Enable Htaccess Blocking is on, ScraperBlock writes mod_rewrite rules to your .htaccess file that reject matched user-agents with a 403 before PHP (and WordPress) loads.

Example Rules

# BEGIN ScraperBlock
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} (GPTBot|ChatGPT-User|Google-Extended|CCBot|ClaudeBot) [NC]
RewriteRule ^ - [F,L]
</IfModule>
# END ScraperBlock
⚠️

Htaccess blocking only works on Apache servers. It has no effect on Nginx, LiteSpeed (unless .htaccess compatibility is enabled), or other server types. Do not enable this setting on non-Apache servers.

Activation & Deactivation Behaviour

  • On plugin activation (if htaccess blocking is enabled in settings): rules are written automatically.
  • On plugin deactivation: all ScraperBlock htaccess rules are removed.
  • On settings save (toggling htaccess blocking): rules are synced automatically.