
WordPress security hardening is the process of locking down your WordPress site so hackers, bots, and malware cannot get in. WordPress powers more than 40% of all websites, making it the most targeted platform on the web — but most attacks are automated and exploit well-known weaknesses: outdated plugins, weak passwords, and default settings. This guide walks you through practical hardening steps you can apply today, even if you are not a developer.
1. Keep WordPress, Themes, and Plugins Updated
Outdated plugins and themes are the single biggest way WordPress sites get hacked. Researchers consistently find that most newly discovered WordPress vulnerabilities live in plugins, not in core. Enable automatic updates for minor releases, and update plugins and themes promptly — ideally on a fixed weekly schedule. Before a major update, take a backup so you can roll back if something breaks.
Equally important: delete plugins and themes you do not use. A deactivated plugin still sits on your server and can be scanned for vulnerabilities, so “deactivated” is not the same as “safe.” Keep one default theme as a fallback and remove the rest. Stick to reputable sources for new tools — never install nulled or pirated premium plugins, which frequently hide malware backdoors. You can explore trusted free resources on the KamiWeb plugins page and the free tools collection.
2. Strengthen Your Login Security
Your login page is the front door of your site, and bots knock on it thousands of times a day. Start with a strong, unique admin password of at least 20 characters, generated by a password manager and never reused elsewhere. Change the default “admin” username if you still have it, since attackers already know it.
Next, enable two-factor authentication (2FA). Even if a password leaks through phishing or a data breach, a time-based code from your phone makes the stolen password useless on its own. Free plugins such as WP 2FA add this in minutes. Finally, limit login attempts so repeated failures block the attacking IP — WordPress allows unlimited attempts by default. For more on this threat, read our guide on protecting WordPress logins from brute-force attacks.
3. Protect wp-config.php and Set Correct File Permissions
The wp-config.php file holds your database credentials, so it deserves special protection. Set its permissions to 600 (owner read/write only), and block web access to it through .htaccess. Also disable the built-in theme and plugin editor by adding define('DISALLOW_FILE_EDIT', true); — if an attacker ever gains admin access, this stops them editing theme files from the dashboard.
Use the correct permissions across your installation: directories 755, files 644, and never 777. Also block PHP execution inside wp-content/uploads, since uploaded files should never be able to run code.

4. Put a Firewall in Front of Your Site
A web application firewall (WAF) filters malicious requests before they reach WordPress. Cloudflare’s free plan blocks many known attack patterns and bad bots, while WordPress-native options such as Wordfence add malware scanning, login monitoring, and a firewall tuned to WordPress threats. A security plugin also gives you file-integrity scanning, alerting you when a core file changes unexpectedly.
Remember that a plugin is a helper, not a substitute for the fundamentals: updates, strong authentication, least-privilege user roles, and a firewall working together. Give each user only the role they need, and review accounts regularly to remove old or unknown ones.
5. Disable XML-RPC and Features You Do Not Use
XML-RPC is an old WordPress interface frequently abused for brute-force attacks and DDoS amplification. If your site does not need it (most blogs and business sites do not), disable it with a security plugin or a small .htaccess rule. Also turn off directory listing, and hide your WordPress version number so scanners cannot match your site to known vulnerabilities.
6. Back Up Regularly — and Test Your Backups
Backups turn a breach from a disaster into an inconvenience. Set up automated backups stored off your server — for example, in cloud storage — and keep several restore points. Crucially, test restoring a backup at least once: an untested backup is a hope, not a plan. Pair backups with security logging so you can spot login attempts and file changes quickly.
If your site ever shows a blank page after an update or a security incident, our guide to fixing the WordPress white screen of death will help you recover step by step.
Frequently Asked Questions
Is WordPress secure by default?
WordPress core is actively maintained and secure when kept updated, but default settings — unlimited login attempts and the dashboard file editor — leave gaps. Hardening closes those gaps.
Do I need a paid security plugin?
Not necessarily. Free tiers of reputable plugins cover scanning, login protection, and firewall rules for most small sites. Paid plans add real-time threat feeds, which matter more for high-traffic or e-commerce sites.
How often should I update my site?
Check for updates weekly and apply security updates immediately, taking a backup before major releases. Auto-updates for minor core releases and trusted plugins keep the window of exposure short.
Conclusion
WordPress security hardening is not a one-time task — it is a habit. Update everything, lock down logins with strong passwords and 2FA, protect wp-config.php, run a firewall, disable what you do not use, and keep tested backups. Work through this checklist once, then repeat it monthly, and your site will be far harder to compromise than average. For more guides, visit the KamiWeb homepage and the KamiWeb blog.
