WindCodex ScraperBlock Developer Reference
Constants
| Constant | Value | Description |
|---|---|---|
SCRAPERBLOCK_VERSION | e.g. '1.0.3' | Current plugin version |
SCRAPERBLOCK_PLUGIN_FILE | __FILE__ | Plugin main file path |
SCRAPERBLOCK_PLUGIN_DIR | plugin_dir_path() | Plugin directory |
SCRAPERBLOCK_PLUGIN_URL | plugin_dir_url() | Plugin URL |
SCRAPERBLOCK_PLUGIN_BASE | plugin_basename() | windcodex-scraperblock/windcodex-scraperblock.php |
Filters
| Filter | Arguments | Description |
|---|---|---|
scraperblock_bypass_request | $bypass (bool), $user_agent (string), $ip (string), $remote_addr (string) | Return true to let a request skip runtime blocking. By default only local WordPress loopback and Plugin Check requests are bypassed. Does not change robots.txt or .htaccess rules. |
scraperblock_log_max_entries | $max (int) | Number of block log entries to keep (default 50) |
Actions
| Action | Arguments | Description |
|---|---|---|
scraperblock_before_settings | - | Fires at the top of the ScraperBlock settings page |
Options
| Option Key | Type | Default | Description |
|---|---|---|---|
scraperblock_settings[protection_enabled] | string yes/no | yes | Master toggle |
scraperblock_settings[enable_robots_blocking] | string yes/no | yes | robots.txt directives |
scraperblock_settings[enable_htaccess_blocking] | string yes/no | no | htaccess rules |
scraperblock_settings[enable_meta_noai] | string yes/no | yes | Meta noai tags |
scraperblock_settings[enable_per_page_control] | string yes/no | yes | Per-page editor box |
scraperblock_settings[enable_rate_limit] | string yes/no | yes | Rate limiting |
scraperblock_settings[requests_per_minute] | int | 60 | Rate limit threshold |
scraperblock_settings[allow_ai_search_bots] | string yes/no | no | Allow AI search and assistant bots |
scraperblock_settings[custom_user_agents] | string | '' | Custom user agents, one per line |
Other options: scraperblock_logs (the last 50 blocked requests).
Post Meta
| Meta Key | Value | Description |
|---|---|---|
_scraperblock_disable_protection | yes | Set by Disable protection for this page/post |
When Blocking Runs
| Layer | Hook |
|---|---|
| Runtime user-agent blocking | template_redirect (priority 0) |
noai meta tags | wp_head (priority 1) |
robots.txt rules | robots_txt filter |