How to secure a WordPress site from hackers

🔑 Key Takeaways

  • Most WordPress hacks exploit weak passwords and outdated software.
  • Updates, strong logins, and a security plugin stop the vast majority.
  • Backups are your safety net if the worst happens.

WordPress powers a huge share of the web, which makes it a favorite target for automated attacks. The good news: almost all of those attacks exploit the same few weaknesses — and closing them is straightforward. Here’s how to secure your WordPress site in 2026.

1. Keep everything updated

Outdated core, themes, and plugins are the number-one way sites get hacked. Enable automatic updates where you can, and check regularly. An updated site closes the holes attackers rely on.

2. Use strong logins

  • Never use “admin” as your username.
  • Use a long, unique password (a password manager makes this painless).
  • Enable two-factor authentication for an extra layer.
  • Limit login attempts to block brute-force bots.

3. Install a security plugin

A plugin like Wordfence adds a firewall, malware scanning, and login protection. It’s the closest thing to a security guard for your site, and the free version covers most needs.

4. Choose a secure host

Good hosts add server-level protection, isolation between accounts, and automatic malware scanning. Cheap, careless hosting can undermine everything else you do.

5. Always have backups

💾 Your safety net: Automatic off-site backups mean that even in a worst-case hack, you can restore a clean version of your site in minutes.

6. Use SSL

Encrypt traffic with a free SSL certificate (usually one click in your host’s panel). It protects data and builds trust.

Security starts with a secure host.

See Secure Hosting →

Frequently asked questions

How do most WordPress sites get hacked?
Through outdated plugins/themes and weak passwords — both easily prevented.

Do I need a paid security plugin?
Not to start. Free versions of tools like Wordfence protect most sites well.

The bottom line

WordPress security isn’t complicated: update everything, lock down logins, add a security plugin, host with a reputable provider, and keep backups. Do these and you’ll stop nearly every attack.


WordPress Security: Hardening the 43% of the Web That Attackers Test First

WordPress powers over 43% of all websites, which makes every unpatched plugin a mass-market attack surface — Patchstack logged thousands of new plugin vulnerabilities last year alone. The encouraging flip side: the overwhelming majority of compromises exploit a handful of preventable weaknesses. A weekend of hardening puts a site ahead of the automated bots that cause most breaches.

Updates are 90% of the game

Core WordPress auto-updates itself for minor releases; the risk lives in plugins and themes. Enable auto-updates for trusted plugins, review the rest weekly, and ruthlessly delete anything deactivated — disabled plugins still expose vulnerable code. Before major updates, snapshot a backup. Sites running fewer than 15 well-maintained plugins have measurably fewer incidents than plugin-hoarders.

Logins: where the bots hammer first

Brute-force attempts hit wp-login.php within hours of any site going live. Countermeasures in order of value: strong unique passwords via a manager, two-factor authentication (Wordfence Login Security or WP 2FA, free), limiting login attempts, and renaming the default admin username. Changing the login URL (WPS Hide Login) cuts log noise but is obscurity, not security — do it last, not first.

Security plugins compared

Wordfence free provides a malware scanner and endpoint firewall; its premium (~$119/year) gets real-time rule updates. Solid Security (formerly iThemes, ~$99/year) focuses on hardening checklists. Sucuri’s platform (~$200+/year) bundles a cloud WAF and, crucially, professional malware cleanup. Running two security plugins simultaneously causes conflicts — choose one. For most sites: Wordfence free plus good habits beats a paid plugin plus complacency.

The hosting layer matters more than plugins

A quality host provides isolation between accounts, a web application firewall, malware scanning and free SSL. Managed WordPress hosts (Kinsta, WP Engine, SiteGround) patch server software and often auto-fix hacked sites free. If you are on $2/month shared hosting, a neighbor’s compromised account can become your problem; the upgrade to a reputable host is a security spend, not a hosting spend.

Cloudflare: free protection most sites skip

Cloudflare’s free tier hides your origin IP, absorbs DDoS traffic, and lets you rate-limit or challenge requests to wp-login.php and xmlrpc.php. Add managed rules on the $25/month Pro tier for OWASP protection. Fifteen minutes of setup eliminates entire attack classes before they reach your server.

Hardening details that pay off

Disable XML-RPC unless you need it (it multiplies brute-force efficiency). Disable file editing in the dashboard with a define in wp-config. Set file permissions to 644/755 and protect wp-config.php. Use SFTP only, never plain FTP. Add security headers (HSTS, X-Frame-Options). Give every human their own account with the minimum role — author, not admin — and audit users quarterly.

If you get hacked anyway

Isolate: put the site in maintenance mode. Restore from a clean backup predating the compromise (this is why 30+ days of retention matters), then update everything and rotate every password and salt key. If there is no clean backup, Sucuri or your managed host’s cleanup service is worth the money — partial manual cleanups almost always leave a backdoor.

Common mistakes

Believing a security plugin substitutes for updates. Keeping nulled or pirated themes — a huge share arrive pre-infected. One shared admin login for the whole team. No offsite backups, which turns an annoying hack into a fatal one. And ignoring PHP versions: anything below PHP 8.1 is past end-of-life and unpatched.

Final thoughts

The 80/20 of WordPress security: update weekly, use 2FA, run Wordfence free, front the site with Cloudflare, keep offsite backups, and host somewhere reputable. Total cost can be zero beyond decent hosting. Attackers automate; your defense should too — schedule it, and it stops being scary.


Frequently Asked Questions

How do I know if my WordPress site is already compromised?

Warning signs: unknown admin users, spam pages in Search Console, traffic drops, or files changed without updates. Run a Wordfence scan, check for rogue users, and compare core files against originals. Quiet infections are common — malware often hides for weeks before doing anything visible.

Is two-factor authentication really necessary for a small blog?

Yes, because attacks are automated and indiscriminate — bots brute-force every WordPress login they find, regardless of site size. Free 2FA plugins neutralize the entire category in five minutes of setup. Small is not safe; small is just unmonitored.

Do I need a paid security plugin?

Most sites do not. Wordfence free plus Cloudflare free, disciplined updates and offsite backups cover the realistic threat model. Paid tiers earn their fee mainly through faster firewall rule updates and professional cleanup services — valuable for revenue sites, optional for blogs.