Web Security · May 19, 2023
How to Protect Your WordPress Website from Hacking
A practical WordPress hardening checklist covering updates, identity, plugins, backups, monitoring, penetration testing, and recovery readiness.
WordPress remains a frequent target because its core, themes, plugins, credentials, hosting stack, and administration workflows create a broad attack surface. Effective protection is a maintained security programme, not a one-time plugin installation.
Patch the complete stack
Keep WordPress core, themes, plugins, PHP, the web server, database, and operating system supported and patched. Remove abandoned extensions instead of leaving them disabled, and test updates in staging when the site is business-critical.
- Maintain an owner and update window.
- Subscribe to vendor and vulnerability alerts.
- Remove unused themes, plugins, accounts, and integrations.
- Prioritise actively exploited internet-facing vulnerabilities.
Protect identities and administration
Require unique passwords and phishing-resistant MFA where available. Limit administrator accounts, separate publishing from administration, and restrict access to the administrative interface using identity-aware access, VPN controls, or trusted network paths.
- Disable shared administrator accounts.
- Rate-limit and monitor login attempts.
- Review privileged users regularly.
- Secure hosting, registrar, CDN, email, and backup accounts—not only WordPress.
Reduce plugin and supply-chain risk
Install extensions only from trusted, maintained sources. Review update history, support status, required permissions, and whether the capability can be delivered without another plugin. Nulled themes and plugins are an unacceptable supply-chain risk.
Prepare to detect and recover
Maintain tested, encrypted backups outside the production hosting account. Centralise security logs, monitor file changes and administrator activity, and define how the team will contain, investigate, clean, restore, and communicate during an incident.
- Test restoration—not only backup creation.
- Protect backup credentials and retention settings.
- Scan restored content before returning it to production.
- Rotate credentials and invalidate sessions after compromise.
Validate with security testing
Automated scanning helps find known weaknesses; manual application testing examines authentication, authorisation, payment flows, custom plugins, APIs, and business logic. Retest important fixes and repeat assessments after major releases or architecture changes.
Harden the hosting and delivery layer
The site is only as resilient as its hosting account, DNS, CDN, deployment process, and recovery controls. Use supported PHP and database versions, isolate sites from one another, restrict file permissions, prevent PHP execution in upload-only directories, and keep secrets outside the web root.
- Protect domain registrar and DNS accounts with MFA.
- Use TLS everywhere and redirect all HTTP requests.
- Apply secure headers and a restrictive Content Security Policy after testing.
- Disable directory listing and unnecessary remote administration.
- Separate staging from production data and credentials.
Build a repeatable incident playbook
A compromised WordPress site should not be “cleaned” by deleting the first suspicious file. Preserve evidence, identify the initial access path, inspect users and scheduled tasks, compare the filesystem with known-good code, review the database for injected content, rotate every connected credential, and rebuild from trusted sources where practical.
Contain
Restrict access, place the site behind maintenance controls if needed, and stop malicious outbound communication without destroying evidence.
Eradicate
Remove persistence, vulnerable extensions, unauthorised administrators, web shells, injected database content, and compromised deployment keys.
Recover and learn
Restore service carefully, increase monitoring, validate business flows, notify affected parties where required, and track corrective actions to closure.
Security checklist
What to carry forward.
01Patch quickly.
02Minimise privileged access.
03Treat plugins as software supply chain.
04Monitor changes and identities.
05Keep tested off-site backups.
06Validate custom functionality manually.