Most WordPress sites are not hacked by someone who chose them. They are found by automated scans looking for a known weak plugin, a guessable login or an exposed file. These checks close the doors those scans look for.
Updates
- Keep WordPress core, themes and plugins current. Most real-world break-ins use a vulnerability that already had a fix.
- Delete plugins and themes you do not use. Deactivated code can still be attacked.
- Replace abandoned plugins. If a plugin has not been updated in a year, look for an alternative.
- Run a supported PHP version. See our PHP upgrade guide.
Logins and users
- Use unique, long passwords stored in a password manager, for every account.
- Turn on two-factor authentication for every administrator.
- Give people the lowest role they need. An editor does not need to be an administrator.
- Remove old accounts for staff, agencies and freelancers who no longer work on the site.
- Limit login attempts, with a plugin or at your firewall.
Configuration
- Turn off the file editor in the dashboard by adding
define( 'DISALLOW_FILE_EDIT', true );towp-config.php. - Serve the whole site over HTTPS and redirect plain HTTP to it.
- Disable XML-RPC if nothing you use needs it; it is a common target for password guessing.
- Put a web application firewall in front of the site. Cloudflare’s free plan already filters a lot of automated traffic.
Backups and monitoring
- Keep daily backups off the server, and test a restore at least once. A backup you have never restored is a guess.
- Watch for changes: uptime monitoring, and alerts for new administrator accounts or changed core files.
If you think you have been hacked
Put the site in maintenance mode, change every password, and restore from a clean backup taken before the problem started. Then find the way in, usually an outdated plugin, and close it, or the same thing happens again. If you need help with that, email [email protected].
Want this done for you, at one fixed price?
Request a quote