Skip to content

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.

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:

Terminal window
wp --url=https://site.example option update patchstack_anti_bruteforce_attempts 10
wp --url=https://site.example option update patchstack_anti_bruteforce_minutes 5
wp --url=https://site.example option update patchstack_anti_bruteforce_blocktime 60
wp --url=https://site.example option update patchstack_block_bruteforce_ips 1

For an array option, use JSON input so WordPress stores an array:

Terminal window
wp --url=https://site.example option update patchstack_basic_firewall_roles '["administrator"]' --format=json

The 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:

Terminal window
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.

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 nameValue typeRegistered defaultDescription
disable_htaccessboolean0Stop hardening .htaccess writes. Existing rules remain; this does not disable runtime security headers.
basicscanblockboolean1Block common scanner file requests through .htaccess.
prevent_default_file_accessboolean1Block access to default WordPress files such as readme.html, license.txt and wp-config-sample.php through .htaccess.
index_viewsboolean1Disable directory listings through .htaccess.
block_debug_log_accessboolean1Block access to the WordPress debug log through .htaccess.
block_fake_botsboolean1Select fake-bot blocking rules from the hardening API.
proxy_comment_postingboolean0Select proxy comment-posting restrictions from the hardening API.
image_hotlinkingboolean0Select image hotlink protection from the hardening API.
firewall_custom_rulesstring""Custom rules placed in Patchstack’s managed .htaccess block.
firewall_custom_rules_locstring"bottom"Place custom rules at top or bottom of the managed block.
plugineditboolean1Disable the WordPress plugin and theme file editors.
userenumboolean1Restrict anonymous author-ID requests, the REST users routes and the users sitemap.
hidewpversionboolean1Remove WordPress generator output. This does not hide every possible version disclosure.
application_passwords_disabledboolean1Disable WordPress application passwords, where supported by WordPress.
xmlrpc_is_disabledboolean1Disable WordPress XML-RPC methods, including authenticated methods and pingbacks. Third-party methods may remain.
json_is_disabledboolean0Restrict anonymous REST requests, with an exception for Contact Form 7 routes. Existing REST permission checks still apply.
add_security_headersboolean1Add security headers to WordPress HTTP responses independently of .htaccess writing.
disable_curl_decodingboolean0Opt 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_loginboolean0Enable the custom login URL and temporary IP access to the normal login routes.
rename_wp_loginstring"swlogin"Custom login URL slug.
login_2faboolean0Offer user enrollment and require codes for enrolled accounts when this site enforces 2FA. See login protection.
login_whiteliststring""Newline-separated IP addresses, IPv4 wildcards/ranges, or CIDRs exempt from the IP-based login ban. This does not bypass 2FA.
captcha_typestring"v2"v2: checkbox; invisible: invisible v2; v3: score-based; turnstile: Cloudflare Turnstile.
captcha_public_keystring""Site key for v2.
captcha_private_keystring""Secret key for v2.
captcha_public_key_v3string""Site key for invisible reCAPTCHA v2.
captcha_private_key_v3string""Secret key for invisible reCAPTCHA v2.
captcha_public_key_v3_newstring""Site key for reCAPTCHA v3.
captcha_private_key_v3_newstring""Secret key for reCAPTCHA v3.
captcha_public_key_turnstilestring""Site key for turnstile.
captcha_private_key_turnstilestring""Secret key for turnstile.
captcha_on_commentsboolean0Check CAPTCHA on anonymous WordPress comment submissions.
captcha_login_formboolean0Check CAPTCHA on the WordPress and WooCommerce login forms.
captcha_registration_formboolean0Check CAPTCHA on WordPress registration, public multisite signup and WooCommerce registration forms.
captcha_reset_pwd_formboolean0Check CAPTCHA on WordPress and WooCommerce lost-password forms.
activity_log_is_enabledboolean1Enable the activity logger. Login-ban enforcement has its own switch and counters.
activity_log_failed_loginsboolean1Legacy failed-login audit preference retained for settings compatibility; see the logging notes below.
activity_log_failed_logins_dbboolean0Include failed-login audit events in uploads to Patchstack App. This does not switch login bans on or off.
activity_log_postsboolean0Record post-related activity when activity logging is enabled.
activity_log_commentsboolean0Record comment-related activity when activity logging is enabled.
basic_firewallboolean1Enable the PHP firewall. Other hardening and IP-block settings are separate.
basic_firewall_rolesarray["administrator", "editor", "author", "contributor"]Roles exempt from legacy firewall rules. Individual newer rules can define their own role restrictions.
firewall_ap_enabledboolean0Enable auto-prepend firewall installation. Shared installer changes on multisite are controlled from the primary site of the primary network.
log_redactionboolean0Redact 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_ipsboolean0Enable IP-based login bans independently of activity-log settings.
anti_bruteforce_blocktimeinteger60Minutes to block an IP after it reaches the failed-login threshold.
anti_bruteforce_attemptsinteger10Failed-login attempts needed to trigger a ban.
anti_bruteforce_minutesinteger5Window in minutes for counting failed-login attempts.
autoblock_blocktimeinteger1Duration in minutes of an automatic firewall IP ban.
autoblock_attemptsinteger60Eligible blocked firewall requests needed to trigger an automatic IP ban.
autoblock_minutesinteger1Window in minutes for counting eligible blocked firewall requests.
firewall_ip_headerstring""A trusted $_SERVER key such as HTTP_X_FORWARDED_FOR. Empty uses automatic IP detection, with REMOTE_ADDR as a fallback.
ip_block_liststring""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 nameValue typeRegistered defaultDescription
hits_last_30array[]Cached attack counts for the last 30 days.
hits_all_timeinteger0All-time attack counter.
non_vpatches_presentinteger or string"?"Number of non-vPatch rules, or ? until known.
vpatches_presentinteger or string"?"Number of vPatches, or ? until known.
fixes_presentinteger or string"?"Vulnerabilities with an available update, or ? until known.
vulns_presentinteger or string"?"Known vulnerability count, or ? until known.
auto_updatearray[]Legacy automatic-update selections, such as plugin, theme, core and vulnerable. Network-scoped on multisite; the App can turn existing selections off.
firewall_rules_v3JSON string"[]"Current vPatch rules.
firewall_rules_v3_apJSON string"[]"Auto-prepend rules.
whitelist_rules_v3JSON string"[]"Current firewall whitelist rules.
firewall_rulesJSON string""Legacy firewall rules.
whitelist_rulesJSON string""Legacy firewall whitelist rules.
whitelist_keys_rulesJSON string""Payload-key whitelist rules.
firewall_ap_errorstring""Auto-prepend installation or refresh error.
ip_header_computedboolean0Whether automatic client-IP header detection has run.
ip_header_force_computeboolean0Request client-IP header detection again.
rename_wp_login_whitelistarray[]Temporary IP access records for the custom login URL.
environment_hashstring""Hash of detected server environment values.
software_data_hashstring""Hash of the last successfully synchronized inventory.
software_upload_attemptedboolean0Whether a software sync has been attempted.
license_expirystring""Subscription expiry date supplied by the API.
clientidstring or integer""Site client identifier from the API key.
secretkeystring""Stored signing secret, encrypted when supported.
secretkey_noncestring""Nonce for the encrypted signing secret.
license_freeboolean0Whether the connected site uses the free plan.
api_tokenarray or string""Cached bearer token and expiry; empty before a token is available.
subscription_classstring or integer""Subscription class supplied by the API.
last_license_checkinteger0Timestamp of the last license check.
last_syncinteger0Timestamp of the last successful API request.
whiteliststring""General firewall whitelist entries.
show_settingsboolean0Legacy settings-display state.
firewall_log_lastidinteger0Legacy firewall upload cursor.
eventlog_lastidinteger0Legacy activity upload cursor.
ott_actionstring""Secret for one-time IP-header detection.
managedboolean0Whether the site is managed by a third party.
managed_textstring""Text shown for a third-party-managed site.
latest_vulnerablearray[]Per-site vulnerability state used to decide when to refresh rules.
site_idinteger0Site identifier in Patchstack App.
activation_secretstring""Secret for instant activation.
activation_timeinteger or string""Instant-activation start timestamp; empty until set.

These entries are created as needed, rather than registered with the configuration defaults above. They are not additional App policy settings.

Full option nameScopePurpose
patchstack_network_plugin_updatesNetwork; defaults to offNetwork 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_pluginsNetwork, or single-sitePending legacy vulnerable-only plugin updates. Failed attempts remain pending for retry.
patchstack_2fa_enforcedNetworkExpiring internal lookup of whether a network has a site enforcing 2FA.
patchstack_db_versionSiteDatabase schema version string, separate from the plugin version.
patchstack_log_schema_lock, patchstack_log_schema_attempts, patchstack_log_schema_retry_afterSiteMigration lease, retry count and next retry time. Use the database-update controls instead of editing these.
patchstack_firewall_log_processing, patchstack_eventlog_processingSiteExpiring upload leases containing an expiry and owner token; these are no longer boolean switches.
patchstack_firewall_log_ap_processingSite; obsoleteLegacy auto-prepend processing flag, removed during import.
patchstack_htaccess_rules_hash, patchstack_htaccess_removal_pendingNetwork, or single-siteLast managed-rule fingerprint and pending hardening removal.
patchstack_cron_offsetSiteStored 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.

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.

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.

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.

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:

Terminal window
wp option update patchstack_basic_firewall 1
wp option update patchstack_disable_htaccess 1
wp option update patchstack_basicscanblock 0
wp option update patchstack_prevent_default_file_access 0
wp option update patchstack_index_views 0
wp option update patchstack_block_debug_log_access 0
wp option update patchstack_block_fake_bots 0
wp option update patchstack_proxy_comment_posting 0
wp option update patchstack_image_hotlinking 0
wp option update patchstack_pluginedit 0
wp option update patchstack_userenum 0
wp option update patchstack_hidewpversion 0
wp option update patchstack_application_passwords_disabled 0
wp option update patchstack_xmlrpc_is_disabled 0
wp option update patchstack_json_is_disabled 0
wp option update patchstack_add_security_headers 0
wp option update patchstack_disable_curl_decoding 0
wp option update patchstack_mv_wp_login 0
wp option update patchstack_login_2fa 0
wp option update patchstack_block_bruteforce_ips 0
wp option update patchstack_captcha_on_comments 0
wp option update patchstack_captcha_login_form 0
wp option update patchstack_captcha_registration_form 0
wp option update patchstack_captcha_reset_pwd_form 0
wp option update patchstack_activity_log_is_enabled 0
wp option update patchstack_activity_log_failed_logins 0
wp option update patchstack_activity_log_failed_logins_db 0
wp option update patchstack_auto_update '[]' --format=json

This 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:

Terminal window
wp site option update patchstack_disable_htaccess 1
wp site option update patchstack_auto_update '[]' --format=json

An 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
}