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
| Priority | Control | Specifics (WordPress) |
|---|---|---|
| P0 | Automatic updates | Enable auto-updates for core, plugins, themes. Back up before major updates |
| P0 | Delete the unused | Delete unused plugins/themes, don't just deactivate (leftover files are still a target) |
| P0 | Strong admin + 2FA | Strong password + two-factor. Avoid the admin username; least-privilege roles |
| P1 | Minimize plugins | Vet update frequency, adoption, known CVEs before installing. Keep the count low |
| P1 | Protect login | Login-attempt limits. Restrict exposure of wp-admin/wp-login.php |
| P1 | Reduce exposure | Restrict xmlrpc.php if unused. Suppress REST-API user enumeration |
| P1 | Backups | Offline/separate recoverable backups + restore tests + tamper detection |
| P2 | wp-config & secrets | Set authentication keys/salts, protect wp-config.php, disable debug display in prod |
| P2 | File permissions | ~644 files / 755 dirs. Disallow PHP execution in the uploads dir |
| P2 | HTTPS/headers/updates | Force 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-adminreachable 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.phpcan 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.phpif 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.phpwith 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_DISPLAYoff). 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.
Secrets and config aren't exposed
/wp-config.php doesn't return its contents, and that backups (.zip/.sql) or .env-type files aren't fetchable by URL.Admin names and versions aren't leaking
?author=1 and similar don't expose an admin username, and that directory listing is off.Login protection and 2FA work
admin user remains.Updates, backups, headers
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).
Read next
- Hub: security by framework · Laravel security
- Checking for intrusion: how to check if your website or server was hacked
- Practice: the vulnerability-response playbook · backup essentials
- Secrets/auth: keep secrets out of public directories · what 2FA is · what phishing is
- Breaking: WordPress 7.1.4 flaw CVE-2026-119977 (update-window RCE, auto-updates and version check)
- Alert: CVE-2026-87902 (unauthenticated file inclusion in WordPress core, fixed in 7.1.2)
- Tools: security headers checker · CVE/KEV lookup
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.