WordPress Security Hardening: A Step-by-Step Guide for 2026
Lock down logins, plugins, file permissions, XML-RPC, backups and updates. A practical WordPress hardening guide from engineers who clean up hacked sites.

WordPress powers a large share of the web, which makes it the most targeted platform too. The core software is maintained by a dedicated security team, but most hacks come from outdated plugins, weak passwords and poor hosting. These steps close the most common gaps.
1. Start with good hosting
Your host is your first line of defence. Look for account isolation (CloudLinux), a web application firewall, malware scanning and automatic backups. Our WordPress hosting includes these by default, along with LiteSpeed caching for speed.
2. Update core, themes and plugins
- Enable automatic minor and security updates for WordPress core.
- Update plugins weekly, ideally after testing on a staging copy.
- Delete unused plugins and themes β deactivated code can still be exploited.
- Never install "nulled" (pirated) premium plugins; they frequently contain backdoors.
3. Harden logins
- Use unique administrator usernames (never "admin").
- Enforce strong passwords and two-factor authentication for all editors and administrators.
- Limit login attempts and consider restricting
/wp-adminby IP for office-only teams. - Remove dormant accounts and review roles monthly.
4. Lock down the file system
- Directories 755 and files 644;
wp-config.php600 or 640. - Disable the built-in file editor by adding
define('DISALLOW_FILE_EDIT', true);towp-config.php. - Block PHP execution inside
/wp-content/uploads. - Rotate the security keys and salts in
wp-config.phpafter any incident.
5. Reduce the attack surface
- Disable XML-RPC if you do not use the mobile app or Jetpack.
- Hide version numbers and directory listings.
- Use a modern supported PHP version β older versions no longer receive security fixes.
6. Back up and test restores
Keep daily off-server backups with at least 14β30 days of history. Malware is often discovered weeks later, so you need a clean point to return to. Read our backup strategy guide.
7. Secure WooCommerce and payments
If you sell online, use HTTPS on every page, verify payment callbacks on the server and never trust amounts sent from the browser. See our secure checkout guide and the WooCommerce M-PESA plugin.
8. Monitor
Set up uptime monitoring, file-change alerts and log reviews. Register your site in Google Search Console so you are notified of security issues.
What to do if you are hacked
- Put the site into maintenance mode and change all passwords (hosting, database, WordPress, FTP, email).
- Restore a clean backup or have professionals remove the malware.
- Update everything and remove the vulnerable plugin.
- Request a review in Search Console if Google flagged the site.
The official WordPress hardening documentation covers more advanced options.
Want experts to handle it? Our website maintenance plans include updates, monitoring and clean-up. Also see the small business security checklist.
Share this article
Was this article helpful?
Your vote helps us write better guides.
