Security Guide
How to Protect Your WordPress Site
The checklist ordered by real-world impact: the five steps that stop most attacks, the extras worth doing, and what to do the day something breaks anyway.
WordPress powers roughly forty percent of the web, which makes it the world's largest attack surface — and also the best-defended platform in terms of available tooling. Attacks are overwhelmingly automated: bots brute-forcing logins, exploiting outdated plugins, and uploading backdoors through vulnerable upload forms. Every measure below targets one of those doors, ordered by how much real risk it removes.
The five steps, in detail
1. Keep everything updated — automatically
Since WordPress 3.7, minor core updates install themselves; plugins and themes can be set to auto-update individually since 5.6. The fear of a breaking update is real but overblown on a managed host — WP Engine, for instance, runs Smart Plugin Manager to test plugin updates before deploying them, which is precisely the middle ground between "never update" and "yolo updates". The rule of thumb: auto-update minor core releases and trusted, low-risk plugins; stage anything business-critical before it goes live.
2. Harden the login sequence
Every WordPress login page on the internet gets hit by bot brute-force daily. Two-factor authentication makes stolen passwords nearly useless; login lockouts after a few failed attempts make bots burn out; renaming or moving /wp-login.php is optional — the first two are not. Delete accounts that no longer log in, and change the default "admin" username if it still exists: an unused "admin" account is still a gift to bots.
3. Backups: daily, offsite, restore-tested
The uncomfortable truth is that no defense is absolute. Backups are what turn a disaster into an inconvenience. Keep them offsite — on the same server they die with the server — and actually test the restore once. On managed hosting, backup retention is part of the plan: WP Engine retains 30–60 days; some competitors keep only 14. That difference matters exactly on the day you need it, and it's a detail worth checking before you sign up.
4. Choose hosting that isolates
On cheap shared hosting, a compromised neighbor site can leak into yours via server-level vulnerabilities. Isolated container-per-site architecture (WP Engine's platform, Kinsta's Google Cloud setups) removes that class of risk entirely. Also verify the host keeps PHP and server software current — that's their job, not a plugin's. This single decision does more than any plugin for the "someone else's hack becomes my hack" scenario.
5. Filter traffic with a firewall
Cloudflare's free tier already blocks most volumetric junk at the edge. A plugin WAF (Wordfence) catches application-level attacks that get through. Use one or both — but see our security plugins comparison before stacking several, because two firewalls fighting over the same requests create as many problems as they solve.
Worth doing, lower priority
- Disable file editing in wp-config (
DISALLOW_FILE_EDIT) so a compromised admin can't edit themes inline. - Limit XML-RPC if you don't use it — legacy pingbacks and
xmlrpc.phpare a common abuse vector for amplification and brute-force. - Set proper database table prefixes at install time — mildly useful at install, cosmetic as a later change.
- Hide version numbers — mostly hygiene; bots probe regardless, but it removes one fingerprint.
- Restrict file permissions and disable directory listing on shared or unmanaged setups.
If you are already hacked
Don't panic-patch. Take the site offline if it's actively distributing malware, restore from the last clean backup, then rotate all passwords and recheck for the vulnerable plugin that let it in. Sucuri's free scanner and Wordfence both produce file-level evidence of what changed. Rebuilding from a clean backup beats "cleaning" a live hack nine times out of ten — a backdoor you miss today is how they walk back in next week.
A security checklist in order
- Enable automatic minor core updates.
- Enable 2FA on every admin account; delete unused accounts.
- Confirm backups run daily and are stored offsite; do one test restore.
- Confirm your host isolates sites and patches PHP/server software.
- Add one firewall layer (edge or plugin WAF) — not five.
Related reading
Next step
Spend an hour this week, not a weekend next month
The five steps take under an hour on most sites: updates, 2FA, backup check, hosting check, firewall.