Key takeaways
- Outdated plugins and weak passwords cause most WordPress hacks.
- Add two-factor authentication and limit login attempts.
- Delete unused plugins and themes, and avoid nulled software.
Most compromised WordPress sites are broken into through outdated software or weak passwords — both preventable.
Keep everything updated
Update WordPress core, plugins and themes promptly. Enable automatic updates for minor core releases and for plugins you trust. Delete inactive plugins and themes — they can still be exploited.
Lock down logins
- Use a unique, long password for every admin account.
- Add two-factor authentication with a reputable plugin.
- Limit login attempts to slow down password-guessing attacks.
- Don’t use
adminas a username, and give users only the role they need.
Choose plugins carefully
Install from the official directory or reputable vendors, check when a plugin was last updated, and avoid “nulled” (pirated) premium plugins — they often contain malware.
Harden the configuration
Add to wp-config.php to stop code editing from the dashboard:
define('DISALLOW_FILE_EDIT', true);
Keep file permissions at 755 for folders and 644 for files, and protect wp-config.php with 600 or 640.
Use HTTPS everywhere
Install SSL, force HTTPS and update your site URLs to https://.
Back up and monitor
Keep automatic off-site backups and test restoring them. A security plugin or your host’s malware scanning can alert you to changed files.