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.

1. UpdatesOutdated plugins are the #1 infection vector. Enable automatic updates for plugins and core — or use a host that tests them first.
2. LoginsUnique passwords, 2FA enabled, login page rate-limited, unused admin accounts deleted.
3. BackupsDaily, stored offsite, restore-tested. A backup you have never restored is a hope, not a plan.
4. HostingIsolated server environments stop one hacked neighbor from becoming your problem. Managed hosts patch PHP and the web server for you.
5. FirewallFilter malicious traffic before it reaches WordPress — at the edge (Cloudflare) or via a security plugin's WAF.
6. Least privilegeEditors edit, admins administer. Never share one admin account between people.

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.php are 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

  1. Enable automatic minor core updates.
  2. Enable 2FA on every admin account; delete unused accounts.
  3. Confirm backups run daily and are stored offsite; do one test restore.
  4. Confirm your host isolates sites and patches PHP/server software.
  5. 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.