Most hacked WordPress sites aren’t targeted by a clever human. They’re found by automated bots scanning for outdated plugins, weak admin passwords and exposed files. This checklist walks through the defences that actually stop those attacks, in the order that gives you the most protection for the least effort, and ends with a calm, step-by-step plan for the day something goes wrong.
1. Keep WordPress, plugins and themes updated
Outdated plugins and themes are the most common way into a WordPress site. When a vulnerability is fixed in an update, the fix itself tells attackers what to look for, and bots start scanning for unpatched sites soon after. Every day you delay an update is a day your site is on that list.
- Turn on automatic updates for WordPress core minor releases (these are mostly security fixes) and for well-maintained plugins you trust.
- Delete, don’t just deactivate, plugins and themes you no longer use. Deactivated code still sits on the server and can still be exploited if it has a vulnerable file that can be reached directly.
- Remove abandoned plugins. If a plugin hasn’t been updated in a long time or has been closed in the official directory, find a maintained replacement.
- Never install “nulled” (pirated) premium plugins or themes. They are a classic delivery method for backdoors.
- Keep PHP current. Your host’s control panel usually lets you choose the PHP version. Older versions stop receiving security fixes.
For business-critical sites, test major updates on a staging copy first.
2. Lock down accounts, passwords and logins
Clean up admin accounts and user roles
Every account with administrator access is a door into your whole site. WordPress has built-in roles (Administrator, Editor, Author, Contributor, Subscriber), and the safest approach is to give each person the lowest role that lets them do their job.
- Review Users and remove anyone who no longer needs access, such as former staff or a developer who finished a project.
- Don’t use a username like “admin” or your site name. These are the first ones bots try.
- Writers should be Authors or Editors, not Administrators.
- Use a separate, everyday Editor account for writing, and log in as Administrator only when you need to change settings or plugins.
- Look for administrator accounts you don’t recognise. An unknown admin is a strong sign of a past compromise.
Use strong passwords and two-factor authentication
Every account with Editor rights or higher should have a long, unique password generated by a password manager. Reused passwords are dangerous because a breach on a completely unrelated website can hand attackers the exact login for yours.
Then add two-factor authentication (2FA). With 2FA, signing in requires a second proof, such as a code from an authenticator app or a passkey, so a stolen password alone isn’t enough. WordPress doesn’t include 2FA in core, but several reputable plugins add it, and many security plugins include it as a feature. Require it for all administrators and editors at minimum.
Store the 2FA backup codes somewhere safe and offline.
Limit and protect the login page
Bots constantly attempt to guess passwords on wp-login.php. Even when they fail, they waste server resources and fill your logs. A few measures cut this noise sharply:
- Limit login attempts. A security plugin or your host can temporarily block an IP address after several failed attempts.
- Disable XML-RPC if you don’t need it. This older interface can be abused for brute-force attempts. Some apps and services still rely on it, so check before turning it off.
- Add a firewall rule or CAPTCHA on the login page if attacks are heavy.
- Restrict access by IP if your team always works from fixed addresses. This is very effective but inconvenient for people who travel.
Changing the login URL reduces bot noise, but it isn’t real protection on its own.
3. Set sensible file permissions and harden configuration
File permissions control who on the server can read, write or run each file. Overly generous permissions let a compromised plugin or another account on the same server alter your files.
| Item | Common recommended setting | Why |
|---|---|---|
| Folders | 755 | Owner can write; everyone else can only read and enter |
| Files | 644 | Owner can write; others can only read |
wp-config.php |
640 or 600 (or stricter, if your host supports it) | Contains your database password and secret keys |
| Anything at 777 | Never | Anyone on the server could change it |
The right values can vary with how your host runs PHP, so check their documentation before changing things. A few other configuration settings are worth adding to wp-config.php:
define( 'DISALLOW_FILE_EDIT', true );
This removes the built-in theme and plugin code editor from the dashboard, so an attacker who gets into an admin account can’t simply paste malicious code into your theme. Also make sure directory listing is disabled on your server and that the uploads folder doesn’t allow PHP files to run. Many hosts handle these by default; it’s worth confirming.
4. Backups that actually restore
A backup you’ve never restored is a hope, not a plan. Many site owners discover during an emergency that their backups were incomplete, stored on the same server that got hacked, or quietly stopped running months ago.
The backup checklist
- Back up both the database and the files (especially
wp-contentandwp-config.php). - Store copies off the server, in cloud storage or with a separate backup service.
- Keep several versions, so you can go back to a point before an infection that went unnoticed for weeks.
- Schedule backups to match how often the site changes. A busy shop needs more frequent backups than a monthly blog.
- Get an alert when a backup fails.
Test a restore
- Pick a recent backup.
- Restore it to a staging site, a subdomain or a local environment, never on top of your live site for a test.
- Log in, click through key pages, check images load and forms work.
- Write down how long it took and any steps that tripped you up.
- Repeat every few months, and after changing hosts or backup tools.
5. Security plugins, firewalls and monitoring
A security plugin or a web application firewall (WAF) can block known attack patterns, scan for malware and warn you about changed files. Popular options include Wordfence, Solid Security and Sucuri, and many managed hosts and CDNs provide a firewall at the network level. Features and pricing change, so compare current offerings rather than relying on old reviews.
Run one main security plugin, not three. Overlapping security tools can conflict, slow the site and produce confusing results.
Watch for injected scripts
A common sign of compromise is malicious JavaScript added to your pages, often used to redirect visitors, show spam or steal payment details at checkout. It can hide in theme files, plugin files, or inside database content and widget settings. Ways to catch it:
- Enable file-change alerts so you know when core, plugin or theme files are modified.
- Occasionally view your page source and look for unfamiliar
<script>tags or scripts loaded from domains you don’t recognise. - Check your site in an incognito window and on mobile. Some malware only shows itself to logged-out visitors or visitors arriving from search engines.
- Monitor search console messages and uptime alerts. Security warnings from search engines are often the first outside signal.
- Consider a Content Security Policy (CSP) header, which tells browsers which script sources are allowed. It takes some care to configure but limits what injected code can do.
6. Secure your hosting, CDN, DNS and API tokens
Your WordPress login is only one layer. Whoever controls your hosting account, domain registrar, DNS or CDN can take over the whole site without touching WordPress at all. These accounts deserve even more protection.
- Turn on 2FA for your hosting control panel, domain registrar, DNS provider, CDN and the email account they all send password resets to.
- Use SFTP or SSH instead of plain FTP, and use SSH keys where possible.
- Give API tokens the narrowest scope they need. A token that only purges cache shouldn’t be able to edit DNS records.
- Never store tokens in theme files, public code repositories or shared documents. Keep them in environment variables or a secrets manager.
- Rotate tokens and database passwords when someone leaves the team or after any suspected incident.
- Enable registrar lock on your domain to make unauthorised transfers harder.
7. What to do if you’re hacked
Work methodically. Rushing often means cleaning symptoms while leaving the backdoor in place.
- Contain it. Put the site in maintenance mode or ask your host to take it offline if it’s attacking visitors.
- Preserve evidence. Download a copy of the current files, database and server logs before changing anything. You’ll need them to find how the attacker got in.
- Change every credential. Hosting, SFTP, database, all WordPress admin passwords, API tokens and the email accounts linked to them. Generate new secret keys (salts) in
wp-config.phpto log everyone out. - Find the entry point. Check logs for suspicious logins or requests, and look for outdated or vulnerable plugins.
- Clean or restore. Restore from a clean backup taken before the compromise, or replace core, plugin and theme files with fresh copies from official sources. Then check the database and uploads folder for leftover malicious code.
- Remove unknown users and review every remaining administrator.
- Patch the hole. Update or remove the vulnerable component before going live again, or you’ll be reinfected.
- Request reviews. If search engines or browsers flagged your site, request a review once it’s clean.
- Notify where needed. If customer data may have been exposed, you may have legal duties to inform people. Seek advice relevant to your country.
If this feels beyond your skills, a professional malware-removal service or your host’s security team is money well spent.
Related reading on Kairo Report
- ClickFix and Fake CAPTCHA Scams: How the Win+R Trick Hijacks PCs
- Passkeys Explained: How Passwordless Sign-In Works and How to Start
Key takeaways
- Updates, deleted unused plugins and strong 2FA-protected logins stop most automated attacks.
- Give each user the lowest role they need, and audit administrator accounts regularly.
- Keep off-site, versioned backups and actually test restoring them.
- Protect hosting, DNS, CDN and registrar accounts as carefully as WordPress itself.
- If hacked: contain, preserve evidence, change all credentials, clean, patch, then go live.
FAQ
Is WordPress itself insecure?
WordPress core is actively maintained and receives security fixes regularly. Most compromises come from outdated plugins and themes, weak passwords, or insecure hosting, all of which are under the site owner’s control.
Do I need a paid security plugin?
Not necessarily. Free tiers of reputable plugins, combined with updates, 2FA and good backups, cover the essentials for many small sites. Paid options or managed firewalls make more sense for shops and busy sites.
How often should I run this checklist?
Check updates weekly, review users and test a backup restore every few months, and revisit the full list whenever you change hosts, add team members or install major new plugins.

