Most hacked WordPress sites are not targeted. They are found — by scanners looking for the same handful of weaknesses.
The checklist
- Keep WordPress, themes and plugins updated.
- Remove plugins and themes you do not use.
- Use strong passwords and two-factor authentication.
- Limit login attempts and change the default admin username.
- Take automated backups stored off the server.
- Use a firewall and malware scanning.
If you are already hacked
Take a backup for forensics, change all credentials, remove the malicious files, and close the entry point. Deleting the visible payload without fixing the entry point just delays the next infection.
If you have already been hacked, my WordPress cleanup and speed service covers malware removal and hardening.