WP options
This reference describes WordPress plugin 2.3.8, including the options it registers and additional state it creates while running. Defaults below are the values used when an option is first added; an upgrade preserves values that already exist. Patchstack App policies and license synchronization can supply different values.
Most hardening features require a connected paid site. An option being stored does not make a feature available on a free site. For the user-facing controls, see Hardening.
Setting options
Section titled “Setting options”Use the App controls or WP-CLI to persist a setting. Register WP filters in a must-use plugin when you need a runtime callback instead. Constants belong in wp-config.php.
For example, configure the login-ban threshold and duration before enabling it:
wp --url=https://site.example option update patchstack_anti_bruteforce_attempts 10wp --url=https://site.example option update patchstack_anti_bruteforce_minutes 5wp --url=https://site.example option update patchstack_anti_bruteforce_blocktime 60wp --url=https://site.example option update patchstack_block_bruteforce_ips 1For an array option, use JSON input so WordPress stores an array:
wp --url=https://site.example option update patchstack_basic_firewall_roles '["administrator"]' --format=jsonThe login IP whitelist is a newline-separated string, rather than an array. This example sets one entry; replace it with the intended address. Updating the option replaces the existing list:
wp --url=https://site.example option update patchstack_login_whitelist '192.0.2.10'The whitelist exempts matching IPs from login bans; it does not bypass 2FA. Network-scoped settings use different commands, described below.
Storage and multisite
Section titled “Storage and multisite”Most settings, credentials and log tables belong to an individual site. Use wp --url=https://site.example option update ... to select a subsite.
On multisite, .htaccess rule selection and the legacy auto_update selection are read as network options. A network administrator can change these through the network settings or wp site option update. The remote-management grant below is also network-scoped. A per-site policy or signing key does not grant authority to change shared software.
2FA enrollment and throttling belong to the shared WordPress user account and are stored in user metadata, not in the site’s options table. See login protection.
Registered configuration options
| Option name | Value type | Registered default | Description |
|---|---|---|---|
disable_htaccess | boolean | 0 | Stop hardening .htaccess writes. Existing rules remain; this does not disable runtime security headers. |
basicscanblock | boolean | 1 | Block common scanner file requests through .htaccess. |
prevent_default_file_access | boolean | 1 | Block access to default WordPress files such as readme.html, license.txt and wp-config-sample.php through .htaccess. |
index_views | boolean | 1 | Disable directory listings through .htaccess. |
block_debug_log_access | boolean | 1 | Block access to the WordPress debug log through .htaccess. |
block_fake_bots | boolean | 1 | Select fake-bot blocking rules from the hardening API. |
proxy_comment_posting | boolean | 0 | Select proxy comment-posting restrictions from the hardening API. |
image_hotlinking | boolean | 0 | Select image hotlink protection from the hardening API. |
firewall_custom_rules | string | "" | Custom rules placed in Patchstack’s managed .htaccess block. |
firewall_custom_rules_loc | string | "bottom" | Place custom rules at top or bottom of the managed block. |
pluginedit | boolean | 1 | Disable the WordPress plugin and theme file editors. |
userenum | boolean | 1 | Restrict anonymous author-ID requests, the REST users routes and the users sitemap. |
hidewpversion | boolean | 1 | Remove WordPress generator output. This does not hide every possible version disclosure. |
application_passwords_disabled | boolean | 1 | Disable WordPress application passwords, where supported by WordPress. |
xmlrpc_is_disabled | boolean | 1 | Disable WordPress XML-RPC methods, including authenticated methods and pingbacks. Third-party methods may remain. |
json_is_disabled | boolean | 0 | Restrict anonymous REST requests, with an exception for Contact Form 7 routes. Existing REST permission checks still apply. |
add_security_headers | boolean | 1 | Add security headers to WordPress HTTP responses independently of .htaccess writing. |
disable_curl_decoding | boolean | 0 | Opt in to disabling libcurl response decompression on affected Brotli builds. Buffered gzip responses can still be decoded by WordPress. See the filter example. |
mv_wp_login | boolean | 0 | Enable the custom login URL and temporary IP access to the normal login routes. |
rename_wp_login | string | "swlogin" | Custom login URL slug. |
login_2fa | boolean | 0 | Offer user enrollment and require codes for enrolled accounts when this site enforces 2FA. See login protection. |
login_whitelist | string | "" | Newline-separated IP addresses, IPv4 wildcards/ranges, or CIDRs exempt from the IP-based login ban. This does not bypass 2FA. |
captcha_type | string | "v2" | v2: checkbox; invisible: invisible v2; v3: score-based; turnstile: Cloudflare Turnstile. |
captcha_public_key | string | "" | Site key for v2. |
captcha_private_key | string | "" | Secret key for v2. |
captcha_public_key_v3 | string | "" | Site key for invisible reCAPTCHA v2. |
captcha_private_key_v3 | string | "" | Secret key for invisible reCAPTCHA v2. |
captcha_public_key_v3_new | string | "" | Site key for reCAPTCHA v3. |
captcha_private_key_v3_new | string | "" | Secret key for reCAPTCHA v3. |
captcha_public_key_turnstile | string | "" | Site key for turnstile. |
captcha_private_key_turnstile | string | "" | Secret key for turnstile. |
captcha_on_comments | boolean | 0 | Check CAPTCHA on anonymous WordPress comment submissions. |
captcha_login_form | boolean | 0 | Check CAPTCHA on the WordPress and WooCommerce login forms. |
captcha_registration_form | boolean | 0 | Check CAPTCHA on WordPress registration, public multisite signup and WooCommerce registration forms. |
captcha_reset_pwd_form | boolean | 0 | Check CAPTCHA on WordPress and WooCommerce lost-password forms. |
activity_log_is_enabled | boolean | 1 | Enable the activity logger. Login-ban enforcement has its own switch and counters. |
activity_log_failed_logins | boolean | 1 | Legacy failed-login audit preference retained for settings compatibility; see the logging notes below. |
activity_log_failed_logins_db | boolean | 0 | Include failed-login audit events in uploads to Patchstack App. This does not switch login bans on or off. |
activity_log_posts | boolean | 0 | Record post-related activity when activity logging is enabled. |
activity_log_comments | boolean | 0 | Record comment-related activity when activity logging is enabled. |
basic_firewall | boolean | 1 | Enable the PHP firewall. Other hardening and IP-block settings are separate. |
basic_firewall_roles | array | ["administrator", "editor", "author", "contributor"] | Roles exempt from legacy firewall rules. Individual newer rules can define their own role restrictions. |
firewall_ap_enabled | boolean | 0 | Enable auto-prepend firewall installation. Shared installer changes on multisite are controlled from the primary site of the primary network. |
log_redaction | boolean | 0 | Redact firewall payloads and URL query strings when recording logs and before uploading older entries. Recommended for sites handling sensitive personal data; see firewall log redaction. |
block_bruteforce_ips | boolean | 0 | Enable IP-based login bans independently of activity-log settings. |
anti_bruteforce_blocktime | integer | 60 | Minutes to block an IP after it reaches the failed-login threshold. |
anti_bruteforce_attempts | integer | 10 | Failed-login attempts needed to trigger a ban. |
anti_bruteforce_minutes | integer | 5 | Window in minutes for counting failed-login attempts. |
autoblock_blocktime | integer | 1 | Duration in minutes of an automatic firewall IP ban. |
autoblock_attempts | integer | 60 | Eligible blocked firewall requests needed to trigger an automatic IP ban. |
autoblock_minutes | integer | 1 | Window in minutes for counting eligible blocked firewall requests. |
firewall_ip_header | string | "" | A trusted $_SERVER key such as HTTP_X_FORWARDED_FOR. Empty uses automatic IP detection, with REMOTE_ADDR as a fallback. |
ip_block_list | string | "" | Newline-separated IP addresses, IPv4 wildcards/ranges, or CIDRs to block. |
Registered internal options
These values are managed by the plugin or API. Do not edit credentials, rule data or synchronization state as a way to configure a feature.
| Option name | Value type | Registered default | Description |
|---|---|---|---|
hits_last_30 | array | [] | Cached attack counts for the last 30 days. |
hits_all_time | integer | 0 | All-time attack counter. |
non_vpatches_present | integer or string | "?" | Number of non-vPatch rules, or ? until known. |
vpatches_present | integer or string | "?" | Number of vPatches, or ? until known. |
fixes_present | integer or string | "?" | Vulnerabilities with an available update, or ? until known. |
vulns_present | integer or string | "?" | Known vulnerability count, or ? until known. |
auto_update | array | [] | Legacy automatic-update selections, such as plugin, theme, core and vulnerable. Network-scoped on multisite; the App can turn existing selections off. |
firewall_rules_v3 | JSON string | "[]" | Current vPatch rules. |
firewall_rules_v3_ap | JSON string | "[]" | Auto-prepend rules. |
whitelist_rules_v3 | JSON string | "[]" | Current firewall whitelist rules. |
firewall_rules | JSON string | "" | Legacy firewall rules. |
whitelist_rules | JSON string | "" | Legacy firewall whitelist rules. |
whitelist_keys_rules | JSON string | "" | Payload-key whitelist rules. |
firewall_ap_error | string | "" | Auto-prepend installation or refresh error. |
ip_header_computed | boolean | 0 | Whether automatic client-IP header detection has run. |
ip_header_force_compute | boolean | 0 | Request client-IP header detection again. |
rename_wp_login_whitelist | array | [] | Temporary IP access records for the custom login URL. |
environment_hash | string | "" | Hash of detected server environment values. |
software_data_hash | string | "" | Hash of the last successfully synchronized inventory. |
software_upload_attempted | boolean | 0 | Whether a software sync has been attempted. |
license_expiry | string | "" | Subscription expiry date supplied by the API. |
clientid | string or integer | "" | Site client identifier from the API key. |
secretkey | string | "" | Stored signing secret, encrypted when supported. |
secretkey_nonce | string | "" | Nonce for the encrypted signing secret. |
license_free | boolean | 0 | Whether the connected site uses the free plan. |
api_token | array or string | "" | Cached bearer token and expiry; empty before a token is available. |
subscription_class | string or integer | "" | Subscription class supplied by the API. |
last_license_check | integer | 0 | Timestamp of the last license check. |
last_sync | integer | 0 | Timestamp of the last successful API request. |
whitelist | string | "" | General firewall whitelist entries. |
show_settings | boolean | 0 | Legacy settings-display state. |
firewall_log_lastid | integer | 0 | Legacy firewall upload cursor. |
eventlog_lastid | integer | 0 | Legacy activity upload cursor. |
ott_action | string | "" | Secret for one-time IP-header detection. |
managed | boolean | 0 | Whether the site is managed by a third party. |
managed_text | string | "" | Text shown for a third-party-managed site. |
latest_vulnerable | array | [] | Per-site vulnerability state used to decide when to refresh rules. |
site_id | integer | 0 | Site identifier in Patchstack App. |
activation_secret | string | "" | Secret for instant activation. |
activation_time | integer or string | "" | Instant-activation start timestamp; empty until set. |
Additional runtime and network state
Section titled “Additional runtime and network state”These entries are created as needed, rather than registered with the configuration defaults above. They are not additional App policy settings.
| Full option name | Scope | Purpose |
|---|---|---|
patchstack_network_plugin_updates | Network; defaults to off | Network administrator’s grant for remote management using the primary site’s signing key. Despite its name, it covers more than plugin updates. See multisite permissions. |
patchstack_vulnerable_plugins | Network, or single-site | Pending legacy vulnerable-only plugin updates. Failed attempts remain pending for retry. |
patchstack_2fa_enforced | Network | Expiring internal lookup of whether a network has a site enforcing 2FA. |
patchstack_db_version | Site | Database schema version string, separate from the plugin version. |
patchstack_log_schema_lock, patchstack_log_schema_attempts, patchstack_log_schema_retry_after | Site | Migration lease, retry count and next retry time. Use the database-update controls instead of editing these. |
patchstack_firewall_log_processing, patchstack_eventlog_processing | Site | Expiring upload leases containing an expiry and owner token; these are no longer boolean switches. |
patchstack_firewall_log_ap_processing | Site; obsolete | Legacy auto-prepend processing flag, removed during import. |
patchstack_htaccess_rules_hash, patchstack_htaccess_removal_pending | Network, or single-site | Last managed-rule fingerprint and pending hardening removal. |
patchstack_cron_offset | Site | Stored offsets for scheduled jobs. |
Other internal keys include retry queues, signature-replay records and transient counters. They are not supported configuration switches. 2FA user metadata uses the patchstack_2fa_ prefix; existing webarx_2fa_ enrollment is read as a fallback and migrated when it can be saved completely. Let the plugin handle this migration.
Logging and login protection
Section titled “Logging and login protection”block_bruteforce_ips controls the IP-based login ban. It works independently of activity_log_is_enabled, activity_log_failed_logins and activity_log_failed_logins_db. Turning activity logging off does not disable login-ban counters or an active ban.
In the current plugin, failed-login audit events follow the main activity logger. activity_log_failed_logins remains registered for settings compatibility; it is not a separate enforcement switch. activity_log_failed_logins_db controls whether failed-login audit events are included in uploads to Patchstack App.
The 2FA account limit is separate again: five invalid codes trigger a five-minute cooldown. The login-ban attempt and duration settings do not change that limit. See login protection. These settings do not add global CAPTCHA or throttling to every authentication endpoint; see supported authentication paths.
Existing installations and .htaccess
Section titled “Existing installations and .htaccess”Updating the plugin or refreshing unchanged API rules does not, by itself, rewrite existing hardening blocks to adopt a different installation layout. A change to the hardening rules or relevant settings can trigger a write. An explicit empty rules string from the API removes its hardening rules; a missing or malformed response preserves them. Turning the last hardening option off queues removal and retries it if writing fails.
disable_htaccess and PS_DISABLE_HTACCESS stop these writes, including removal. They do not delete existing blocks or stop security headers added at runtime. See .htaccess hardening.
Legacy automatic updates
Section titled “Legacy automatic updates”Patchstack App no longer offers a switch to enable automatic updates. Existing auto_update selections can still run until disabled. The plugin respects WordPress’s global automatic-update policy; vulnerable-only updates retain failed work for retry. See Packages.
Minimal mode
Section titled “Minimal mode”To keep the PHP firewall enabled while disabling optional hardening and activity logging, apply the following settings before activation. On an existing installation, they do not remove .htaccess rules already written. Review any existing auto-prepend installation separately before changing shared server configuration.
For a single site, use wp option update:
wp option update patchstack_basic_firewall 1wp option update patchstack_disable_htaccess 1wp option update patchstack_basicscanblock 0wp option update patchstack_prevent_default_file_access 0wp option update patchstack_index_views 0wp option update patchstack_block_debug_log_access 0wp option update patchstack_block_fake_bots 0wp option update patchstack_proxy_comment_posting 0wp option update patchstack_image_hotlinking 0wp option update patchstack_pluginedit 0wp option update patchstack_userenum 0wp option update patchstack_hidewpversion 0wp option update patchstack_application_passwords_disabled 0wp option update patchstack_xmlrpc_is_disabled 0wp option update patchstack_json_is_disabled 0wp option update patchstack_add_security_headers 0wp option update patchstack_disable_curl_decoding 0wp option update patchstack_mv_wp_login 0wp option update patchstack_login_2fa 0wp option update patchstack_block_bruteforce_ips 0wp option update patchstack_captcha_on_comments 0wp option update patchstack_captcha_login_form 0wp option update patchstack_captcha_registration_form 0wp option update patchstack_captcha_reset_pwd_form 0wp option update patchstack_activity_log_is_enabled 0wp option update patchstack_activity_log_failed_logins 0wp option update patchstack_activity_log_failed_logins_db 0wp option update patchstack_auto_update '[]' --format=jsonThis also turns off 2FA enforcement, login bans, CAPTCHA and login-URL protection on that site. On multisite, another site’s policy can still require 2FA for a shared account. These settings do not change firewall whitelists or virtual patches.
On multisite, run the per-site settings for each intended site using --url. To stop network hardening writes and legacy automatic updates as well, a network administrator can use:
wp site option update patchstack_disable_htaccess 1wp site option update patchstack_auto_update '[]' --format=jsonAn App default site policy can apply the per-site configuration below. Disable any existing legacy automatic updates separately from the site’s Packages tab; they are not enabled through a new policy.
{ "patchstack_basic_firewall": 1, "patchstack_disable_htaccess": 1, "patchstack_basicscanblock": 0, "patchstack_prevent_default_file_access": 0, "patchstack_index_views": 0, "patchstack_block_debug_log_access": 0, "patchstack_block_fake_bots": 0, "patchstack_proxy_comment_posting": 0, "patchstack_image_hotlinking": 0, "patchstack_pluginedit": 0, "patchstack_userenum": 0, "patchstack_hidewpversion": 0, "patchstack_application_passwords_disabled": 0, "patchstack_xmlrpc_is_disabled": 0, "patchstack_json_is_disabled": 0, "patchstack_add_security_headers": 0, "patchstack_disable_curl_decoding": 0, "patchstack_mv_wp_login": 0, "patchstack_login_2fa": 0, "patchstack_block_bruteforce_ips": 0, "patchstack_captcha_on_comments": 0, "patchstack_captcha_login_form": 0, "patchstack_captcha_registration_form": 0, "patchstack_captcha_reset_pwd_form": 0, "patchstack_activity_log_is_enabled": 0, "patchstack_activity_log_failed_logins": 0, "patchstack_activity_log_failed_logins_db": 0}