WordPress powers more than 40% of all websites, which makes it the world’s most popular content management system and one of its most attractive targets. The good news is that most WordPress hacks aren’t clever, one-off exploits. They come from automated bots that scan the internet for outdated plugins, weak passwords, and sloppy configurations.
That means a handful of smart habits can block the vast majority of attacks. In this guide, you’ll learn 12 practical steps to secure your WordPress website, whether you run a personal blog, a business site, or an online store.
1. Choose a Secure Hosting Provider
Your website is only as safe as the server it lives on. Cheap, overcrowded shared hosting often means outdated server software and weak isolation between sites. Look for a host that offers:
- Server-level firewalls and malware scanning
- Automatic daily backups
- Up-to-date PHP and MySQL/MariaDB versions
- Isolated accounts, so a hacked neighbor can’t infect your site
- Free SSL certificates and responsive support
Managed WordPress hosting costs more, but it handles much of the heavy lifting for you.
2. Keep WordPress, Themes, and Plugins Updated
Outdated software is one of the most common reasons WordPress sites get hacked. Many updates patch vulnerabilities that attackers already know about and are actively scanning for.
- Leave automatic updates on for WordPress core security releases.
- Enable auto-updates for trusted plugins and themes, or check for updates at least weekly.
- For complex or high-traffic sites, test major updates on a staging copy first.
- Make sure your server runs a currently supported version of PHP.
3. Use Strong, Unique Passwords
Weak and reused passwords are an open door for brute-force and credential-stuffing attacks. Every account tied to your site (WordPress admin, hosting panel, FTP/SFTP, database, and email) should have its own long, random password.
A password manager such as Bitwarden, 1Password, or KeePass makes this painless. Aim for at least 14–16 characters and never reuse a password across services.
4. Enable Two-Factor Authentication (2FA)
Even a strong password can be phished or leaked. Two-factor authentication adds a second check, usually a code from an authenticator app, so a stolen password alone isn’t enough to log in.
Plugins like WP 2FA, Wordfence, and Solid Security make setup simple. Require 2FA for every administrator and editor account, and preferably for everyone who can publish content.
5. Limit Login Attempts and Protect the Login Page
Bots hammer /wp-login.php and /wp-admin all day long, trying thousands of password combinations. You can shut this down by:
- Limiting failed login attempts and temporarily blocking repeat offenders
- Adding a CAPTCHA to the login form
- Restricting access to /wp-admin by IP address if your team works from fixed locations
- Changing the default login URL with a plugin such as WPS Hide Login (this reduces bot noise, but it’s a bonus layer, not a replacement for the steps above)
6. Install a Security Plugin and Web Application Firewall (WAF)
A good security plugin acts like a guard at the gate. It scans files for malware, blocks malicious traffic, and alerts you when something looks wrong. Popular, well-reviewed options include Wordfence, Sucuri, and Solid Security.
For extra protection, put a cloud-based WAF such as Cloudflare or Sucuri in front of your site. It filters bad traffic before it ever reaches your server, which also reduces load and helps against DDoS attempts.
7. Install an SSL Certificate and Force HTTPS
SSL/TLS encrypts the data moving between your visitors and your site, including login credentials and form submissions. Browsers flag non-HTTPS sites as “Not Secure,” and Google treats HTTPS as a ranking signal.
Most hosts offer free certificates through Let’s Encrypt. Once it’s installed, redirect all traffic to HTTPS and force secure logins by adding this line to your wp-config.php file:
define('FORCE_SSL_ADMIN', true);
8. Back Up Your Website Regularly
No security setup is perfect, so backups are your safety net. If your site is hacked, corrupted, or accidentally broken, a clean backup lets you recover in minutes instead of days.
Follow the 3-2-1 rule: keep 3 copies of your data, on 2 different types of storage, with 1 copy stored off-site (such as cloud storage). Tools like UpdraftPlus, BlogVault, and Jetpack Backup can automate this. Run backups daily for active sites, and test a restore occasionally to make sure your backups actually work.
9. Use Only Trusted Themes and Plugins
Plugins and themes are the most common entry point for attackers. Protect yourself by:
- Downloading only from the official WordPress.org directory or reputable commercial developers
- Never using “nulled” or pirated premium themes and plugins, which often contain hidden malware
- Checking when a plugin was last updated, how many active installs it has, and how its support forum looks
- Deleting any plugin or theme you’re not using (deactivated isn’t enough; remove it completely)
The fewer plugins you run, the smaller your attack surface.
10. Apply the Principle of Least Privilege
Not everyone needs administrator access. Give each user only the permissions required for their job: contributors for guest writers, editors for content managers, and administrators only for the people who truly manage the site.
- Avoid using “admin” as a username
- Remove inactive users and former team members promptly
- Review your user list every few months
- Keep a separate, limited account for everyday publishing
11. Harden Your WordPress Configuration
A few small technical tweaks can close common loopholes.
Disable the built-in file editor. This stops attackers from editing theme and plugin code from the dashboard if they gain access. Add this to wp-config.php:
define('DISALLOW_FILE_EDIT', true);
Set correct file permissions. A common baseline is 755 for folders and 644 for files, with wp-config.php locked down more tightly (440 or 400, depending on your host).
Disable directory browsing. On Apache servers, add this line to your .htaccess file so visitors can’t list the contents of your folders:
Options -Indexes
Disable XML-RPC if you don’t use it. This legacy feature is often abused for brute-force and DDoS attacks. Most security plugins can switch it off with one click.
Use unique security keys and salts. These strengthen how login cookies are encrypted. You can generate fresh ones from the official WordPress.org salt generator and paste them into wp-config.php.
12. Monitor, Scan, and Log Activity
Security isn’t a one-time setup. Catching a problem early can be the difference between a quick cleanup and a full-blown disaster.
- Run regular malware scans (weekly at minimum)
- Use an activity log plugin to track logins, plugin changes, and file edits
- Set up uptime monitoring to get alerted if your site goes down
- Connect Google Search Console, which will warn you if it detects hacked content or malware
What to Do If Your WordPress Site Gets Hacked
Even well-protected sites can occasionally be compromised. If it happens, stay calm and work through these steps:
- Contact your host. They can often help identify the breach and may have server-level tools to assist.
- Put the site in maintenance mode to protect visitors while you work.
- Change every password: WordPress, hosting, FTP/SFTP, database, and email.
- Restore a clean backup from before the infection, or clean the site using a malware scanner.
- Remove unknown admin users, plugins, and files.
- Update everything (core, plugins, themes, and PHP) so the same vulnerability can’t be used again.
- Request a review from Google if your site was blacklisted or flagged.
Quick WordPress Security Checklist
- Reliable, security-focused hosting
- WordPress core, plugins, and themes up to date
- Strong unique passwords and 2FA enabled
- Login attempts limited
- Security plugin and firewall active
- HTTPS enforced site-wide
- Automated off-site backups tested
- Only trusted, necessary plugins and themes installed
- User roles reviewed and cleaned up
- File editing disabled and permissions hardened
- Regular scans and activity monitoring
Final Thoughts
Securing a WordPress website doesn’t require advanced technical skills or a big budget. It requires consistency. Start with the basics (updates, strong logins, 2FA, and backups), then layer on a firewall, hardening tweaks, and monitoring.
Attackers go after the easiest targets. By following the steps in this guide, you make your site a much harder one, and protect your data, your visitors, and your reputation in the process.


