This page has affiliate links. If you buy through them, we may earn a commission at no cost to you.
A security plugin is one layer of protecting a WordPress site, not the whole job. Below is the plugin we use, what it handles, and the other habits that keep most sites from ever getting hacked. If your site is already infected, skip to what to do if you’ve been hacked.
“Why would anyone hack my site?”
Almost nobody is targeting you personally. Automated bots scan millions of WordPress sites for weak passwords and known holes in outdated plugins. When one gets in, it uses your site to send spam, host phishing pages, redirect your visitors or infect them. Your traffic and your domain’s reputation are what’s worth stealing. Install any login-protection plugin and within a day you’ll see hundreds of blocked login attempts. That’s normal background noise for every WordPress site.
Who’s responsible: you or your host?
Both. Your host secures the server. You’re responsible for what runs on it: WordPress, your theme, your plugins and your logins. Most hacks we clean up came in through an outdated plugin or a reused password, not through the server.
The plugin we use: BetterShield
We install BetterShield, a free security plugin from WPDeveloper, for hardening and login protection. It’s also what xCloud, our host, now uses to protect WordPress logins. The free version covers what most sites need:
- A security audit that scores your site and explains each finding in plain language.
- One-click hardening fixes, such as turning off file editing in the dashboard, each with an undo.
- Login protection that limits failed attempts and adds a bot check to your forms.
- Two-factor authentication and passkey sign-in for administrator accounts.
- An activity log, and a file check against the official WordPress copies.
BetterShield Ultra, a paid add-on for people who manage sites for others, adds client reports, Slack and webhook alerts, and longer activity history. Whatever plugin you choose, pick one. Running two security plugins at once usually causes conflicts rather than more protection.
What a security plugin can’t do
Hardening makes your site a harder target. It doesn’t keep your software current or give you a way back if something goes wrong. These matter just as much:
Keep everything updated
Most known WordPress vulnerabilities are in plugins, not WordPress itself. Update weekly, and remove plugins you don’t use rather than leaving them deactivated. If a plugin hasn’t been updated in a year or more, replace it. Our post on whether to turn on auto-updates covers how to do this safely.
Watch for known vulnerabilities
A vulnerability scanner checks your installed plugins against a database of reported problems and tells you what to patch. Patchstack is built into xCloud hosting; MalCare is another good option that adds malware scanning and one-click cleanup.
Have backups you’ve tested
A backup is what turns a hack from a disaster into an inconvenience. Keep them off the server, keep several days of history, and restore one now and then to make sure it works. We use BlogVault for this. See our backup and restore guide.
Use strong, unique logins
- Don’t use “admin” as a username. If you have one, create a new administrator with a different name, log in as it, and delete the old account, assigning its content to the new one.
- Use a password manager and a unique password for every account.
- Give each person their own login with the lowest role that lets them do their job.
- Turn on two-factor for anyone who can publish or install plugins.
A few settings worth adding
If your security plugin doesn’t already handle them, this line in wp-config.php stops anyone from editing theme and plugin files from the dashboard, which is a common step after an attacker logs in:
define( 'DISALLOW_FILE_EDIT', true );
Also make sure the whole site runs over HTTPS, and never install “nulled” (pirated) premium themes or plugins. They’re one of the most common ways malware gets in.
What to do if you’ve been hacked
- Don’t delete anything yet. Take a copy of the infected site; it helps find how the attacker got in.
- Change every password: WordPress admins, hosting, SFTP, database and email.
- Restore a clean backup from before the infection, if you have one, then update everything immediately.
- If you don’t have a clean backup, the site needs a proper cleanup, not just a malware scan.
We recover hacked sites for a flat fee: hack recovery removes the malware, closes the way in, and sends you a report of what we found. To have all of this handled every month instead, see our Care Plans.