SiteFort documentation

Hardening

Lock down the WordPress attack surface. Covers server hardening, login protection, password policies, two-factor authentication, WooCommerce and membership 2FA, custom form CAPTCHA, lockouts, and security headers.

Hardening

Hardening reduces the number of ways attackers can fingerprint, access, or abuse WordPress. SiteFort organizes these controls into WordPress Obscurity, Server Hardening, Login Security, Two-Factor Authentication, and Security Headers.

Rollout advice: enable hardening in layers. Start with low-risk information exposure controls, then server rules, then login controls, then strict headers such as CSP or HSTS preload.

WordPress Obscurity

These settings reduce fingerprinting and account discovery. They are usually safe to enable, but REST API restrictions can affect headless frontends, mobile apps, blocks, forms, and integrations.

SettingWhat it doesCheck before enabling
Hide WordPress VersionRemoves version numbers from meta tags, RSS feeds, and script query strings.Safe for most sites.
Clean WordPress HeadRemoves unnecessary meta tags, manifest links, and feed discovery links from the HTML head.Confirm no theme feature relies on a removed discovery link.
Prevent Username in Author SlugPrevents author archive slugs from exposing login usernames and repairs existing matching slugs.Check author archive URLs on publisher sites.
Block User EnumerationBlocks author scanning, REST API user endpoints, oEmbed data, and user sitemaps.Safe for most sites. Confirm author data is not required by a public app.
Disable Theme & Plugin EditorRemoves the built-in code editor from Appearance and Plugins menus.Recommended for production. Use Git, SFTP, or a deployment pipeline for code changes.
Disable Application PasswordsRemoves Application Passwords, which bypass two-factor authentication.Do not enable if mobile apps, external publishing tools, or API clients rely on application passwords.
Restrict REST API AccessRequires authentication for REST endpoints. Core data endpoints require appropriate capabilities and unknown endpoints are blocked for unauthenticated visitors.Open Endpoint Status and allow public endpoints required by your theme, forms, commerce, headless frontend, or integrations.

Endpoint Status shows Endpoint, Status, and Action columns. Status badges include Core Protected, capability names, Core Permissions, Public Allowed, Login Required, and Unrestricted. Actions include Allow Public and Restrict.

Server Hardening

Server hardening prevents direct access to files and directories that should not be browsed or executed. These rules are strongest when written to the web server configuration, because requests can be blocked before WordPress loads.

SettingWhy it mattersVerification
Disable Directory ListingPrevents visitors from browsing folder contents when no index file exists.Open a directory path without an index file and confirm it is not listed publicly.
Block PHP Execution in UploadsStops web shells from executing PHP directly inside uploads.Confirm legitimate media still loads. WordPress should not need to execute PHP from uploads.
Block Direct PHP Access in PluginsPrevents individual plugin PHP files from being executed directly by URL.Verify plugin functionality that uses WordPress routing still works.
Block Direct PHP Access in ThemesPrevents theme PHP files from being executed directly by URL.Check key templates and frontend pages after enabling.
Block Sensitive File AccessBlocks dotfiles, debug files, lock files, version-control metadata, sample config files, and server config fragments.Test a safe blocked path such as a known readme or sample file if available.
XML-RPCChoose Fully Enabled, Disable Pingbacks Only, or Fully Disabled.Disable pingbacks for most sites. Fully disable only if Jetpack, mobile app, or XML-RPC clients are not required.

Manual Configuration Rules provides Server Config Rules and wp-config.php Rules, with actions to show or hide rules, regenerate, copy, verify enforcement, open manual rules, or open advanced settings. Use this when Write to Files is disabled or server configuration is managed outside WordPress.

Login Security

Custom Login URL

Custom Login URL replaces the default WordPress login URL with a custom path. Standard login endpoints are disabled and return an error or redirect based on your setting.

  1. Choose a login slug that is memorable to administrators but not obvious to bots.
  2. Choose a register slug if public registration is enabled.
  3. Copy and store the new login URL before saving.
  4. Choose the default wp-login.php response: 403, 404, or Redirect.
  5. If using Redirect, confirm the redirect target does not reveal the new login path.
Access warning: Pretty permalinks may be required. Keep hosting or file access available before changing the login URL on a production site.

Login Form Protection

SettingWhat it doesRecommended starting point
Limit Login AttemptsLocks out IPs and users after repeated failed login attempts.Start with moderate thresholds, then tune from Lockouts & Recovery.
Bot Detection (CAPTCHA)Requires CAPTCHA verification on supported authentication forms.Enable when brute force or bot attempts continue after lockouts, or when policy requires CAPTCHA.
Restrict Login IdentifierAllows email only, username only, or both based on policy.Email Address Only is recommended when user email addresses are managed and unique.
Block Default Admin Username LoginsRejects authentication attempts using the default admin username.Enable unless a real account still uses that username; rename that account first.
Obfuscate Login Error MessagesUses a generic failure response instead of revealing whether username or password was wrong.Enable on production sites.

Limit Login Attempts supports failed attempts per IP from 1 to 20, failed attempts per user from 1 to 20, detection windows of 5 min, 15 min, 30 min, 1 hour, and 24 hours, and lockout durations of 5 min, 15 min, 30 min, 1 hour, and 24 hours.

For custom frontend login, registration, or checkout forms, see Custom Form CAPTCHA.

Password Policies

Password policies decide what happens when a user reaches the login flow or changes credentials. Apply stronger policy to privileged roles first.

PolicyWhat it doesRecommended use
Breached Password DetectionBlocks known breached passwords and triggers mandatory reset when existing credentials appear in global leaks.Enable for all users when possible.
Enforce Strong PasswordsRejects weak passwords and requires reset when an existing password no longer meets policy.Enable for privileged users at minimum.
Prevent Password ReuseBlocks users from reusing their current password after a reset or voluntary change.Useful for regulated sites and administrator accounts.
Require Password Change on Role PromotionRequires a new password when a user is promoted to Administrator or Editor.Recommended for all production sites.
Password Expiration PolicyRequires rotation after 1 to 365 days.Use only where policy requires periodic rotation; avoid unnecessary rotation for normal users.

Lockouts & Recovery

Lockouts & Recovery shows active lockouts from failed login attempts and recent authentication activity. It is the recovery panel when a legitimate user is blocked by login protection.

Control or stateWhat it meansHow to use it
Active Lockouts / No Active LockoutsWhether an IP or user is currently locked out.Use Unlock for a specific false positive or Unlock All during a broad misconfiguration.
Protection Active / DisabledWhether login attempt limiting is enforcing lockouts.If disabled, historical activity can still appear but new lockouts are not enforced.
Block in FirewallConverts abusive login activity into a firewall block.Use for clearly malicious IPs that keep returning.
Trust (Allowlist)Adds a source to allowlist or trusted handling.Use only for stable office, VPN, or monitoring IPs that you control.
Recent Authentication ActivityShows event, IP, and time.Use to confirm whether a complaint is a real lockout, a wrong password, or another login control.

Two-Factor Authentication

Two-Factor Authentication protects WordPress accounts with a second verification step. SiteFort includes 2FA Enforcement for site-wide policy and My 2FA for the current user's enrollment and recovery settings.

AreaWhat it controlsOperational guidance
Your 2FA StatusShows the current method, recovery code count, setup action, regeneration options, and disable action.Administrators should generate and securely store recovery codes before enforcement begins.
Authenticator AppUses a TOTP authenticator app through a QR code or manual secret.Recommended for administrators, editors, developers, and other privileged accounts.
Email CodeSends a one-time verification code to the user's registered email address during login.Useful where authenticator app rollout is not practical. Verify reliable transactional email delivery before enforcement.
Recovery CodesProvides single-use codes for account recovery when the normal second-factor method is unavailable.Store them separately from the WordPress account. Generating a new set invalidates the previous codes.
Allowed MethodsDefines which 2FA methods users are allowed to choose when enrolling.Authenticator App and Email Code can both be made available. SiteFort prevents removal of the final allowed method.
Enforced RolesDefines which WordPress roles are required to configure and use 2FA.Enabling a method does not automatically enforce 2FA. Apply enforcement separately to the roles that require it.
Grace PeriodDefines how long a user in an enforced role may continue before completing 2FA setup.Use a short rollout period for existing teams. Set to 0 only when immediate enrollment is appropriate.
Remember DeviceDefines how long a successfully verified browser can remain trusted before another 2FA challenge is required.Use shorter periods for higher-risk environments and longer periods where reduced login friction is important.

Allowed methods are Authenticator App (TOTP) and Email Code. Roles include Administrator, Editor, Author, Contributor, and Subscriber. Remember Device Duration supports 0 to 365 days, and Grace Period supports 0 to 30 days.

WooCommerce and membership account integration

SiteFort can expose 2FA enrollment and management on frontend account pages, allowing customers and members to manage account security without entering the WordPress administration area.

WooCommerce

When SiteFort Two-Factor Authentication is enabled and WooCommerce is active, SiteFort automatically adds My Account → Account security. No shortcode, WooCommerce template override, or theme modification is required.

Customers can use Account security to:

  • Enroll in two-factor authentication.
  • Change their active 2FA method.
  • Generate a new set of recovery codes.
  • Disable 2FA when the site's enforcement policy allows it.

The normal WooCommerce login page remains available. When an enrolled user signs in, the password is validated first. SiteFort then requires the second factor before authentication is completed.

WooCommerce integration: the Account security endpoint is added automatically when both SiteFort 2FA and WooCommerce are active. Do not add the 2FA management shortcode separately to the standard WooCommerce My Account area.
Membership and custom account pages

For membership plugins, LMS platforms, customer portals, or custom frontend dashboards, add the following shortcode to the authenticated account page where users should manage their 2FA settings:

[sitefort_2fa_management]

The shortcode displays SiteFort's 2FA management interface for the currently authenticated WordPress user. Depending on the site's policy and current account state, users can enroll, change methods, manage recovery codes, or disable 2FA.

Logged-out visitors receive a generic sign-in message. SiteFort does not expose or generate a login URL from the shortcode.

Caching: authenticated account pages that display [sitefort_2fa_management] should remain dynamic. Exclude those pages from full-page caching for logged-in users.
2FA integration checks
  • Test Authenticator App and Email Code enrollment when both methods are allowed.
  • Generate recovery codes and test one before enforcing 2FA broadly.
  • Confirm WooCommerce customers can open My Account → Account security.
  • Confirm custom account pages display the correct 2FA state for the logged-in user.
  • Confirm users in enforced roles are required to complete enrollment after the configured grace period.
  • Verify transactional email delivery before relying on Email Code.
  • Avoid overlapping 2FA enforcement from another security or authentication plugin.

CAPTCHA on Custom Forms

SiteFort can render CAPTCHA inside custom frontend login, registration, and checkout forms. Configure a CAPTCHA provider in SiteFort before adding a CAPTCHA shortcode to a form.

CAPTCHA on custom login forms

Add the following shortcode inside the custom login form:

[sitefort_captcha action="login"]

When the form uses the standard WordPress authentication flow, SiteFort validates the CAPTCHA automatically during login.

Placement matters: the CAPTCHA shortcode must be rendered inside the HTML form that submits the login request. Adding it elsewhere on the page does not attach CAPTCHA validation to that form.

CAPTCHA on custom registration forms

Add the following shortcode inside the registration form:

[sitefort_captcha action="register"]

Registration systems that use their own submission process must validate the CAPTCHA before creating the WordPress account. Use the SiteFort developer validation API when the registration plugin or custom form does not pass through a supported WordPress registration flow.

Other custom forms

Available CAPTCHA actions are:

  • login
  • register
  • checkout

Custom form processors can validate CAPTCHA submissions through the SiteFort developer API. This is intended for plugin developers, custom integrations, and forms that manage their own submission lifecycle.

Compatibility notes

  • Configure a CAPTCHA provider before adding a SiteFort CAPTCHA shortcode.
  • Test each custom form after integration, especially forms created with page builders.
  • Forms using AJAX, REST APIs, or proprietary authentication may require additional validation integration.
  • CAPTCHA does not replace the form's existing nonce, authorization, input validation, or permission checks.
  • Custom login forms must use the WordPress authentication flow for SiteFort's login-time 2FA challenge to run.

Developer reference

Render SiteFort CAPTCHA from PHP using the appropriate action for the form:

echo do_shortcode( '[sitefort_captcha action="register"]' );

For a custom submission handler, validate the CAPTCHA before completing the protected action:

$result = apply_filters(
'sitefort_validate_captcha',
true,
'register',
'custom'
);

if ( is_wp_error( $result ) ) {
// Stop the submission and display the returned error.
}

The second argument after the initial value identifies the CAPTCHA action. Use the action that matches the form being protected, such as login, register, or checkout.

Security Headers

Security Headers configures browser-level protections. Start with analysis, review recommendations, deploy low-risk headers, then carefully test Content-Security-Policy and HSTS.

  1. Click Analyze Your Security Headers.
  2. Review Deployment recommendation, Recommendations, Read-Only Warnings, and Deployed Headers.
  3. Use Enable / Fix, Configure, or Edit for each header.
  4. Click Refresh Preview or Re-scan after changes.
HeaderPurposeDeployment guidance
Content-Security-PolicyRestricts external resources the browser may load, mitigating XSS and data injection.Start in Report Only. Move to Enforce after scripts, styles, images, fonts, connections, frames, forms, and embedded content are validated.
Strict-Transport-SecurityEnforces HTTPS-only connections.Enable only after HTTPS works reliably. Include subdomains and preload only when every subdomain is HTTPS-ready.
X-Content-Type-OptionsPrevents MIME sniffing and content-type confusion.Usually safe to enable.
X-Frame-OptionsPrevents clickjacking by controlling iframe embedding.Use SAMEORIGIN unless the site should never be framed; use DENY carefully.
Referrer-PolicyControls how much URL information is shared when users navigate away.strict-origin-when-cross-origin is the recommended balance.
Permissions-PolicyRestricts browser APIs such as camera, microphone, geolocation, payment, USB, fullscreen, and autoplay.Disable features the site does not use. Use Self Only for features needed by your domain.

Disclosure header warnings include X-Powered-By, Server, and X-Generator. CSP source tokens include Self, Inline, Eval, HTTPS, Data, Blob, and None where applicable. CSP also supports custom domains and Skip CSP on Admin Pages, which is recommended because WordPress admin relies heavily on inline scripts.

Referrer-Policy Options

Available policies include strict-origin-when-cross-origin, no-referrer, no-referrer-when-downgrade, origin, origin-when-cross-origin, same-origin, strict-origin, and unsafe-url. Avoid unsafe-url on production sites because it sends full paths and query strings.