WordPress Security Guide: 6 Layers to Protect Your Website
WordPress itself is secure – most hacked WordPress sites are hacked through outdated plugins, weak passwords or careless hosting. In this guide I explain the security layers I set up on client websites, with a self-check, a hardening checklist and a step-by-step plan for the worst case.
- The most important measure is boring: keep everything updated and remove what you don’t use.
- Protect every admin account with a unique password and two-factor authentication.
- Think in layers: hosting, WordPress, accounts, plugins, backups and monitoring.
- A tested, off-site backup turns a hack from a disaster into an annoyance.
How WordPress sites really get hacked
Attacks on small business websites are rarely personal. Bots scan millions of sites automatically for known weaknesses. The most common entry points are:
- Outdated plugins and themes with publicly known vulnerabilities – by far the most frequent cause.
- Weak or reused passwords found in data leaks and tried automatically (credential stuffing).
- Pirated “nulled” plugins with hidden malware.
- Abandoned plugins that no longer receive security fixes.
- Insecure hosting or outdated PHP versions.
- Too many admin accounts – former employees, agencies, test users.
Think in security layers
Self-check: how secure is your website?
WordPress security self-check
Six quick questions – your score appears at the end.
Are all plugins, themes and WordPress up to date?
Do all admin accounts use two-factor authentication?
How many administrator accounts exist?
Are backups stored off-site and tested?
Are there inactive plugins or themes installed?
Is login protection active (limit attempts, 2FA, captcha)?
Your score:
Vulnerable. Prioritise updates, 2FA and an off-site backup today – these three steps stop the majority of automated attacks.
Partly protected. Close the remaining gaps with the hardening checklist below.
Well protected. Keep the routine and review users and plugins every quarter.
Layer 1: Updates and plugin hygiene
- Update WordPress, plugins and themes regularly – with a backup beforehand.
- Delete (not just deactivate) plugins and themes you do not use.
- Before installing a plugin, check: last update, active installations, support forum activity and compatibility with your WordPress version.
- Replace plugins that have not been updated for a long time.
- Never install “nulled” premium plugins.
Layer 2: Accounts, passwords and roles
- Use a password manager and a unique, long password for every account.
- Activate two-factor authentication for all users with editor or admin rights.
- Follow the principle of least privilege: authors get the Author role, not Administrator.
- Remove accounts of former employees and agencies immediately.
- Do not use “admin” as username and set a display name different from the login name.
Layer 3: Login protection
- Limit login attempts and block IPs after repeated failures.
- Add a captcha or a honeypot to login and forms.
- Disable XML-RPC if you do not use it (for example for the mobile app or Jetpack).
- Consider changing or protecting the login URL as an extra hurdle against bots – not as your only protection.
Layer 4: WordPress hardening
A few lines in wp-config.php close common attack paths:
// Disable the theme and plugin file editor in the dashboard
define( 'DISALLOW_FILE_EDIT', true );
// Force HTTPS for logins and the admin area
define( 'FORCE_SSL_ADMIN', true );
// Never show PHP errors to visitors on a live site
define( 'WP_DEBUG', false );
define( 'WP_DEBUG_DISPLAY', false );
- Use unique security keys and salts in
wp-config.php. - Set correct file permissions (usually 644 for files, 755 for folders, 600 or 640 for
wp-config.phpif your host allows). - Keep the database user’s rights limited to your WordPress database.
Layer 5: Hosting and server
- Choose a host with a web application firewall, malware scanning and isolated accounts.
- Use a current, supported PHP version.
- Use SFTP or SSH instead of plain FTP.
- Enforce HTTPS with an SSL certificate and security headers such as HSTS and X-Content-Type-Options.
Layer 6: Backups and monitoring
- Automatic daily backups following the 3-2-1 rule, at least one off-site.
- Keep backups for 30 days or more – infections are often discovered late.
- Uptime monitoring and email alerts for failed logins or file changes.
- Google Search Console notifies you if Google detects malware or hacked content.
Hardening checklist
- WordPress, plugins and themes updated
- Unused plugins and themes deleted
- Two-factor authentication active for all admins and editors
- Only necessary administrator accounts exist
- Login attempts are limited
- File editor disabled with DISALLOW_FILE_EDIT
- HTTPS enforced for the whole site
- XML-RPC disabled if not needed
- PHP version is current and supported
- Daily off-site backups, restore tested
- Uptime and security monitoring active
- Search Console set up for security notifications
Hacked? Your emergency plan
- Don’t panic and don’t delete anything yet. Note what you see (redirects, spam pages, warnings) and when it started.
- Put the site into maintenance mode or take it offline to protect visitors.
- Change all passwords: WordPress users, hosting, SFTP, database, email.
- Restore a clean backup from before the infection – or let a professional clean the files and database.
- Update everything and remove the vulnerable plugin or theme that was used to get in.
- Scan again, check for unknown admin users and scheduled tasks.
- Request a review in Google Search Console if your site was flagged.
- Check GDPR obligations: if personal data may have been accessed, you may have to notify the data protection authority within 72 hours.
Restoring a backup without closing the security gap only resets the clock – the same bot will come back. Always find and fix the entry point.
Frequently asked questions
Is WordPress secure?
The WordPress core is maintained by a large security team and is considered secure. Most problems come from outdated or poorly coded plugins, weak passwords and insecure hosting – all of which you can control.
Do I need a security plugin?
A security plugin helps with login protection, firewall rules and monitoring, but it cannot replace updates, strong passwords, 2FA and backups. Choose one well-maintained solution instead of several overlapping plugins.
How do I know if my website has been hacked?
Typical signs are unknown admin users, redirects to other websites, spam pages in Google results, warnings in the browser or Search Console, sudden slowness and emails from your hosting provider about malware.
Should I hide the WordPress login page?
Changing the login URL reduces bot traffic, but it is not real protection. Strong passwords, two-factor authentication and limited login attempts are far more effective.
How often should I check my website’s security?
Updates and backups monthly at the latest, a review of users and plugins every quarter, and a full security review once a year or after major changes.
Want a professional security check?
I review your WordPress setup, close the gaps and set up backups and monitoring – so you can focus on your business.
- 11 views

