ScrapeLock 3.6.0 has 7 actions and 64 filters, read directly from its source code on Nov 19, 2026. The list updates automatically when a new version is released.
How to use these hooks
Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.
// Run your own code when ScrapeLock fires an action
add_action( 'pncp_bans_changed', function( $ip, $until ) {
// Your code runs here.
}, 10, 2 );
// Change a value ScrapeLock is about to use
add_filter( 'pncp_rest_hide_content', function( $value, $arg2 ) {
// Change $value here.
return $value;
}, 10, 2 );Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.
All hooks
-
/** * A ban was added or renewed (blocking at the CDN follows it). */ do_action( 'pncp_bans_changed', $ip, $until ); -
/** * This filter is documented in includes/class-pncp-rest.php */ apply_filters( 'pncp_rest_hide_content', true, $id ? get_post( $id ) : null ); -
/** * Filters the most API calls ScrapeLock makes to the CDN in 5 minutes (300 by * default; Cloudflare allows 1200 for the whole account). */ apply_filters( 'pncp_edge_call_budget', self::CALL_BUDGET ); -
/** * Lets WordPress install minor releases of itself (same branch, e.g. 6.8.1 to * 6.8.2) while the site is locked. The files they change are taken into the * file fingerprint when they match the official checksums of the new version. * Plugin and theme updates still wait for an unlock. */ apply_filters( 'pncp_lockdown_allow_core_minor', false ); -
/** * 3.5: minutes of the first scanner probe ban (0 or less: the full ban at * once). Never longer than "Block for N minutes". Read by the pre-cache check * when its configuration is written. */ apply_filters( 'pncp_probe_first_ban_minutes', 10 ); -
/** * Filter to let a request skip all checks. */ apply_filters( 'pncp_skip_guard', false, $context, $ip ); -
/** * 3.5: plugins that do the same job as ScrapeLock, reported on Site Health * while ScrapeLock's own feature for that job is on. */ apply_filters( 'pncp_conflicting_plugins', $defaults ); -
/** * Filters the code that plugins keep in the database and run, which Lockdown * checks every hour. */ apply_filters( 'pncp_lockdown_db_code', $out ); -
/** * Filters the plugin folders that run each source of pncp_lockdown_db_code, * for the quarantine. */ apply_filters( 'pncp_lockdown_db_code_plugins', $folders ); -
/** * Filters whether the code-check lock of Lockdown is a named lock of the * database server (GET_LOCK()). */ apply_filters( 'pncp_lockdown_db_lock', $usable ); -
/** * Filters the capabilities refused while the site is locked to roles that keep * their work (shop managers and roles that are not ticked on the Lockdown * tab). Capabilities can only be added. */ apply_filters( 'pncp_lockdown_limited_caps', $caps ); -
/** * Filters the options of other plugins that keep their value while the site is * locked, and are put back when they are changed in the database. Options can * only be added. */ apply_filters( 'pncp_lockdown_protected_options', $names ); -
/** * Filters the line shown over the page to a visitor who is not signed in. */ apply_filters( 'pncp_mark_guest_line', $line ); -
/** * Filters the line shown over the page to a signed-in user. */ apply_filters( 'pncp_mark_user_line', $line, $user ); -
/** * Filters the configuration of the pre-cache check before it is written to * config.json. */ apply_filters( 'pncp_precheck_config', $config ); -
/** * 3.5: last word before a scanner probe is logged and banned by WordPress (not * applied by the pre-cache check). The request is refused either way. */ apply_filters( 'pncp_probe_ban', true, $path, $ip ); -
/** * 3.5: the scanner probe list of "Ban scanners on their first probe", key => * PCRE body. Each body is matched as #^/(?:BODY)$#i against the request path * relative to the home path (decoded); write "any depth" as (?:.*\/)? and * escape #. Added keys are checked by WordPress only; only the keys of * PNCP_Probe::RUNTIME_KEYS / SERVER_KEYS are mirrored to the pre-cache check * and the server rules (after the... */ apply_filters( 'pncp_probe_trap_paths', $paths ); -
/** * Filter: the units an anonymous REST read counts toward the REST limit * (clamped to 1-10, and to the limit itself, so the first request of a minute * always passes). */ apply_filters( 'pncp_rest_cost', $cost, $request, $per_page ); -
/** * Filter to add or remove post types. */ apply_filters( 'pncp_rest_post_types', array_values( $types ) ); -
/** * Filter to exclude images. */ apply_filters( 'pncp_watermark_attachment', true, $attachment_id ); -
/** * Fires after ScrapeLock rewrote an image file (watermark added or removed), * for image optimizers and CDNs that keep their own copy of it. */ do_action( 'pncp_watermark_file_changed', $file ); -
/** * Whether visitors get the largest watermarked size instead of the clean * full-size image (zoom, lightbox, Store API, wc/v3, the image of the * product's structured data). */ apply_filters( 'pncp_watermark_replace_full', true, $attachment_id ); -
/** * Whether a watermarked JPEG / WebP size is made from the clean original with * a single lossy save, instead of opening the size WordPress already * compressed and compressing it a second time. Costs one more resize per size; * turn off on very slow servers. */ apply_filters( 'pncp_watermark_single_compression', true ); -
/** * This filter is documented in wp-includes/functions.php */ apply_filters( 'robots_txt', $output, $public ); -
apply_filters( 'pncp_auto_emergency_minutes', self::MINUTES ); -
apply_filters( 'https_local_ssl_verify', false ); -
apply_filters( 'pncp_dns_lookups_per_minute', 20 ); -
apply_filters( 'pncp_ipv6_prefix', 64 ); -
apply_filters( 'pncp_persistent_requests', 100 ); -
apply_filters( 'pncp_reverse_dns', null, $ip ); -
do_action( 'cache_enabler_clear_complete_cache' ); -
apply_filters( 'jpeg_quality', $quality, 'pncp_watermark' ); -
do_action( 'litespeed_control_set_nocache', 'scrapelock' ); -
do_action( 'litespeed_purge_all' ); -
apply_filters( 'pncp_404_exempt', $exempt, $path ); -
apply_filters( 'pncp_ai_search_agents', array( 'OAI-SearchBot', 'ChatGPT-User', 'Claude-SearchBot', 'Claude-User', 'PerplexityBot', 'Perplexity-User', 'DuckAssistBot', 'MistralAI-User' ) ); -
apply_filters( 'pncp_archive_agents', array( 'ia_archiver', 'archive.org_bot', 'heritrix' ) ); -
apply_filters( 'pncp_auto_emergency_factor', self::FACTOR ); -
apply_filters( 'pncp_auto_emergency_hours', 1 ); -
apply_filters( 'pncp_block_framing', true ); -
apply_filters( 'pncp_client_ip', $ip ); -
apply_filters( 'pncp_content_paths', $out ); -
apply_filters( 'pncp_db_new_counters_per_minute', self::DB_NEW_KEYS_PER_MINUTE ); -
apply_filters( 'pncp_edge_max', 500 ); -
apply_filters( 'pncp_edge_rule_limit', 50000 ); -
apply_filters( 'pncp_forward_dns', null, $host ); -
apply_filters( 'pncp_geo_min_ranges', 10000 ); -
apply_filters( 'pncp_geo_source_url', 'https://download.db-ip.com/free/dbip-country-lite-' . $month . '.csv.gz', $month ); -
apply_filters( 'pncp_hotlink_allowed', array( 'google.', 'googleusercontent.', 'bing.com', 'skroutz.gr', 'bestprice.gr', 'facebook.com', 'instagram.com', 'pinterest.' ) ); -
apply_filters( 'pncp_http_library_agents', array( 'curl/', 'Wget/', 'python-requests', 'python-urllib', 'aiohttp', 'httpx', 'Go-http-client', 'node-fetch', 'axios/', '=node', 'undici', 'okhttp', 'Dart/', 'Java/', 'Java-http-client', 'Apache-HttpClient', 'GuzzleHttp', 'libwww-perl', 'HTTP-Tiny', '=Ruby', 'Faraday v', 'Bun/', 'Deno/', 'PowerShell/' ) ); -
apply_filters( 'pncp_human_difficulty', 3 ); -
apply_filters( 'pncp_human_max_per_minute', 20 ); -
apply_filters( 'pncp_integrity_exclude', array( 'paths' => array( 'cache', 'upgrade', 'upgrade-temp-backup', 'wflogs', 'et-cache', 'litespeed', 'w3tc-config', 'wphb-cache' ), 'names' => array( '.git', 'node_modules' ), 'skip' => array(), ) ); -
apply_filters( 'pncp_known_ai_agents', array( 'AddSearchBot', 'AIWebIndex', 'Amzn-SearchBot', 'Amzn-User', 'AzureAI-SearchBot', 'Channel3Bot', 'ExaSearchBot', 'ExaUser', 'GrokBot', 'Grok Bot', 'GrokAppAndroid', 'xAI-Grok', 'KeenableBot', 'Kimi-SearchBot', 'Kimi-User', 'Kimi-Agent', 'LinkupBot', 'ZanistaBot', 'Andibot', 'Aranet-SearchBot', 'iAskBot', 'Gemini-Deep-Research', 'Google-NotebookLM', 'NotebookLM', 'GoogleAgent-URLContext',... ); -
apply_filters( 'pncp_lockdown_guard_sites', 100 ); -
apply_filters( 'pncp_lockdown_network_sites', 1000 ); -
apply_filters( 'pncp_lockdown_network_snapshots', 50 ); -
apply_filters( 'pncp_log_rows_per_minute', 300 ); -
apply_filters( 'pncp_precheck_apcu', true ); -
apply_filters( 'pncp_precheck_new_files_per_minute', 2000 ); -
apply_filters( 'pncp_robots_ai_agents', array_values( $out ) ); -
apply_filters( 'pncp_should_protect', self::decide(), PNCP_Options::get() ); -
apply_filters( 'pncp_surge_sample', self::SURGE_SAMPLE ); -
apply_filters( 'pncp_trap_exempt_agents', array( 'DuckDuckBot', 'Baiduspider', 'SeznamBot', 'PetalBot', 'Sogou', 'Yeti', 'Qwantbot', 'MojeekBot', 'Ecosia' ) ); -
apply_filters( 'pncp_trap_first_ban_minutes', 10 ); -
apply_filters( 'pncp_use_apcu', $ok ); -
apply_filters( 'pncp_visitor_country', $country, $ip ); -
apply_filters( 'pncp_watermark_batch_size', 3 ); -
do_action( 'rt_nginx_helper_purge_all' ); -
apply_filters( 'wp_editor_set_quality', $quality, $mime );
Generated from ScrapeLock's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.
Done for you
Rather have it built for you?
Tell us what should change and we’ll write and test the code using these hooks.
Custom hook snippet
from $49
A small, update-safe change built on the plugin’s own hooks.
- Code written against the plugin’s actions and filters
- Tested on a staging copy of your site
- Install instructions included
Typical turnaround: 2–3 business days
Choose thisPlugin customisation
from $149
New features or changed behaviour, without editing the plugin’s files.
- Built as a companion plugin, so updates never wipe it
- Exact quote before we start
- Tested on staging, then deployed
Typical turnaround: 3–7 business days
Choose thisNot sure which fits? Describe what you need and we’ll suggest the simplest option.
Can't find the right hook?
We can build the customisation for you. Describe what you need: