By framework

WordPress security — a production hardening reference

A WordPress production-hardening checklist: updates, plugins and themes, admin 2FA, admin exposure, wp-config secrets, file permissions and backups.

Published 2026-07-02 Updated 2026-10-23 8 min read
On this page

For: anyone running a WordPress site. No attack steps here — this is a working reference for hardening: a priority-ordered checklist, per-area guidance, and self-verification. For the cross-framework picture, see the security-by-framework hub.

Priority-ordered hardening checklist

Do this table top-down. P0 is top priority, P1 is the most frequent source of incidents, P2 is ongoing maintenance.

P0 ── Prerequisite (do first)

Automatic updates / delete unused plugins & themes / strong admin + 2FA

P1 ── Top source of incidents

Minimize plugins / reduce admin exposure / recoverable backups

P2 ── Ongoing maintenance

wp-config and secrets / file permissions / HTTPS, headers, PHP/dependency updates

Harden in order: P0 (prerequisite) → P1 (top source of incidents) → P2 (ongoing maintenance).
PriorityControlSpecifics (WordPress)
P0Automatic updatesEnable auto-updates for core, plugins, themes. Back up before major updates
P0Delete the unusedDelete unused plugins/themes, don't just deactivate (leftover files are still a target)
P0Strong admin + 2FAStrong password + two-factor. Avoid the admin username; least-privilege roles
P1Minimize pluginsVet update frequency, adoption, known CVEs before installing. Keep the count low
P1Protect loginLogin-attempt limits. Restrict exposure of wp-admin/wp-login.php
P1Reduce exposureRestrict xmlrpc.php if unused. Suppress REST-API user enumeration
P1BackupsOffline/separate recoverable backups + restore tests + tamper detection
P2wp-config & secretsSet authentication keys/salts, protect wp-config.php, disable debug display in prod
P2File permissions~644 files / 755 dirs. Disallow PHP execution in the uploads dir
P2HTTPS/headers/updatesForce HTTPS, HSTS, etc. Keep PHP/DB on supported versions

1. Updates (the top defense)

Most attacks on WordPress are automated tools hitting a published known vulnerability (CVE) at scale. So update speed is your biggest defense.

  • Enable automatic updates for core, plugins, and themes so published vulnerabilities are fixed before they're exploited.
  • For important sites, verify major updates in staging and back up before updating.
  • A skipped update leaves a way in for automated attacks. Don't "do it later."

2. Plugins and themes (attack surface)

Third-party code vulnerabilities are the most common way in. The key is to keep the count low and never leave them unattended.

  • For anything unused, delete rather than deactivate (deactivated files can still be a target).
  • Before installing, check update frequency, adoption, last-updated date, and known CVEs. Avoid abandoned ones.
  • You can check plugin CVEs with the CVE/KEV lookup. Fewer extensions means less update responsibility and less attack surface.

3. Admin accounts and authentication

Most takeovers are brute-force against weak/reused admin accounts, or reuse of leaked passwords.

Common (dangerous)

  • username admin + weak password + no 2FA
  • everyone is an administrator (no role separation)
  • unlimited login attempts
  • wp-admin reachable from anywhere

Correct

  • strong password + 2FA, a username other than admin
  • least-privilege roles (use editor/author appropriately)
  • login-attempt limits (curb brute force)
  • where possible, restrict where wp-admin/wp-login.php can be reached from

For choosing 2FA see what 2FA is; for the route that targets admins see what phishing is.

4. Reduce exposure (admin surface and disclosure)

Attackers first look for something they can use to get in. Cut unused features and unnecessary disclosure.

  • Add login-attempt limits to reduce the effectiveness of brute force.
  • Restrict xmlrpc.php if unused (it can be abused to speed up brute-force attacks and send high-volume requests).
  • Suppress REST-API user enumeration (prevent exposing admin names via ?author= etc.).
  • Disable directory listing and reduce unnecessary version disclosure.
  • Disable file editing from the admin (DISALLOW_FILE_EDIT) to make post-intrusion tampering harder.

5. wp-config and secrets (P2)

  • Set the unique authentication keys/salts and protect wp-config.php with appropriate permissions (never world-readable).
  • Keep secrets like DB credentials off the public surface. Don't leave backups or exports in a public directory (→ keep secrets out of public directories).
  • In production, disable debug display (WP_DEBUG_DISPLAY off). Don't leak internals via errors.

6. Files and uploads (P2)

  • File permissions of roughly 644 files / 755 dirs, and stricter for wp-config.php. Never leave anything world-writable.
  • Don't allow PHP execution in the uploads directory (web-shell defense). Validate upload type and size.
  • Use tamper detection (file-change monitoring) to spot post-intrusion changes early.

7. HTTPS, headers, backups (P2)

  • Force HTTPS + HSTS. Resolve mixed content.
  • Add security headers (check your own site with the security headers checker).
  • Keep offline/immutable backups + restore tests so you can recover (→ backup essentials). Your last resort for recovering from ransomware and defacement.

8. Hosting and dependencies (P1–P2)

  • Keep PHP and the database on supported versions. Don't leave EOL versions in place.
  • Know your hosting's patch status (on shared hosting, that includes the provider's response).
  • A WAF is a supplement. Set up the basics (updates, minimization, auth, backups) first.

Verify: is your WordPress actually hardened?

Building it isn't the end — it's done only once you've checked. These are defensive self-checks against your own site.

1

Secrets and config aren't exposed

On your own domain, confirm /wp-config.php doesn't return its contents, and that backups (.zip/.sql) or .env-type files aren't fetchable by URL.
2

Admin names and versions aren't leaking

Confirm ?author=1 and similar don't expose an admin username, and that directory listing is off.
3

Login protection and 2FA work

Confirm login-attempt limits work and admins have 2FA enabled. Check that no leftover admin user remains.
4

Updates, backups, headers

Confirm auto-updates are on, that you can actually restore from a backup, and that HTTPS/HSTS are present via the headers checker.

These four checks tell you whether the site is hardened. If you already suspect it was altered or taken over, see how to check if your website or server was hacked.

This site's view: don't add too many plugins, and don't leave them unattended

What works for WordPress isn't special config but the operational discipline of "don't over-add extensions, don't leave them unattended." Plugins are convenient, but each one adds a responsibility to keep updating. The focus is working through the table above from the top: automate updates, keep plugins minimal, and defend with strong auth and recoverable backups. It looks WordPress-specific, but it is really the basics that apply to any technology (updating dependencies, minimizing what is public, authentication, recovery).

Sources and scope

These primary references support the settings, scope or remediation discussed above; links were checked on October 23, 2026. Consult their version and configuration conditions. Checklist priorities and lessons are this site's guidance, not a full-article revalidation or a safety guarantee.

FAQ

QWhat should I do first to secure WordPress?
A

The three P0 items: (1) enable automatic updates for core, plugins, and themes so published known vulnerabilities (CVEs) are fixed before they're exploited; (2) delete unused plugins/themes (not just deactivate) to cut the attack surface; (3) protect admin accounts with a strong password and two-factor authentication (2FA), and avoid the username admin. These three alone stop most automated attacks. Next, reduce admin exposure and set up backups.

QHow many plugins is too many?
A

The rule is 'only the minimum you need.' Each plugin adds attack surface and a 'responsibility to keep updating.' Before installing, check update frequency, adoption, last-updated date, and known vulnerabilities; and for anything unused, delete rather than deactivate (deactivated files can still be a vulnerability target). The same goes for themes.

QShould I disable xmlrpc.php?
A

If you don't use it, restricting or disabling it is recommended. xmlrpc.php serves remote posting and pingbacks, but it can also be abused to speed up brute-force attacks and send high-volume requests. If you do use features that need it (some app integrations), limit it to the methods you need or protect it with rate/IP limits. Check whether you actually use it first.

QDoes a security plugin make me safe?
A

A security plugin helps but doesn't solve everything. Adding one while the basics (automatic updates, minimal plugins, strong admin auth, backups, reduced admin exposure) is missing won't fix the vulnerabilities. Work the checklist on this page first, then use a plugin to supplement things like login-attempt limits and tamper detection.

QWhat's the bare minimum?
A

(1) automatic updates, (2) delete unused plugins/themes, (3) strong password + 2FA for admins, (4) login-attempt limits and reduced admin exposure, (5) recoverable offline backups + tamper detection. These five stop most automated attacks. See the checklist and sections above for detail.