WordPress powers a large part of the web – which also makes it the most attacked CMS. The good news: almost all successful attacks use the same handful of weaknesses. Work through this checklist and your site will be a much harder target than most. Not sure whether WordPress is right for you? Read our self-hosted WordPress review and static site or WordPress?
Update everything
- Enable automatic updates for WordPress core minor releases and for trusted plugins.
- Update themes and plugins at least weekly; check the changelog for security fixes.
- Run a supported PHP version – see which PHP version your site should run.
Clean up plugins and themes
- Delete (not just deactivate) plugins and themes you do not use.
- Avoid plugins that have not been updated for a year or more.
- Never install “nulled” premium plugins or themes from unofficial sites: they very often contain backdoors.
Protect your logins
- Use a unique, long password for every administrator, stored in a password manager.
- Turn on two-factor authentication for all accounts with editing rights.
- Do not use “admin” as a username, and give people only the role they need.
- Limit login attempts, at server level or with a plugin.
Hosting and server
- Choose a host that isolates accounts, offers a firewall and malware scanning (see choosing a hosting plan).
- Use HTTPS everywhere, including the admin area.
- Use SFTP instead of FTP, and set sensible file permissions (typically 644 for files, 755 for folders).
- Disable file editing in the dashboard by adding
define('DISALLOW_FILE_EDIT', true);towp-config.php.
Backups
Make automatic backups of files and database, store them outside your hosting account and test a restore now and then. Our guide to website backups explains the 3-2-1 rule.
Monitor
- Use an uptime monitor so you know when your site goes down (see web hosting uptime).
- Check Google Search Console for security issues.
- Keep an eye on new administrator accounts and unknown files.
Frequently asked questions
Do I need a security plugin?
A good security plugin can help with login protection, file monitoring and a firewall, but it is no substitute for updates, strong passwords and backups. Some hosts provide these protections at server level.
My site was hacked. Should I just restore a backup?
Restore a clean backup from before the hack, then immediately update everything and change all passwords, or the attacker will simply come back through the same hole.