WordPress powers a huge slice of the web, which makes it a favorite target, not because WordPress is “inherently insecure,” but because it’s everywhere, endlessly extended with plugins/themes, and often managed by busy humans.
If you want a realistic picture of what you’re defending against, look at what security vendors see at scale. In Wordfence’s 2024 security report, their systems blocked/logged 54+ billion malicious requests and blocked 55+ billion password attacks in 2024. That’s not meant to scare you, it’s meant to normalize something important: your site will be probed, even if it’s small.
The good news: most WordPress compromises happen through a handful of repeatable paths. If you lock down permissions (roles + least privilege) and implement a short list of hardening controls, you reduce your risk dramatically.
This guide walks you through the essentials, cleanly and practically.
The three most common ways WordPress sites get owned
Before hardening, you need a simple threat model. Most successful attacks fall into one (or more) of these buckets:
1) Stolen or guessed logins (credential attacks)
Attackers try leaked passwords from other breaches, brute-force weak passwords, or phish admins.
This pattern isn’t unique to WordPress. Verizon’s DBIR highlights how often stolen credentials show up in real incidents; 88% of breaches in the “Basic Web Application Attacks” pattern involved stolen credentials.
2) Vulnerable plugins/themes (the biggest WordPress-specific risk)
WordPress core is generally well-maintained, but the ecosystem is massive. Wordfence reported 96% of vulnerabilities disclosed in 2024 were in plugins (not core).
Also: vulnerability volume is rising. Wordfence notes vulnerabilities disclosed in 2024 were up 68% vs. 2023.
3) Misconfiguration & persistence (file permissions, backdoors, old versions)
Even after “cleanup,” reinfections happen when the underlying weakness remains. Sucuri’s 2023 report found 39.1% of compromised CMS applications were outdated at infection time, and 49.21% of compromised websites had at least one backdoor at remediation.
That’s why security isn’t just “scan + remove malware.” It’s access control + hardening + maintenance.
Security principle #1: Least privilege (it’s not optional anymore)
The OWASP Top 10 repeatedly flags access control failures as a top risk, including violations of least privilege (“deny by default”).
In WordPress terms, least privilege means:
- Users get only the minimum role/capabilities needed for their work.
- Admin access is rare, not normal.
- You separate accounts by purpose (daily work vs. admin tasks).
- You remove access fast when someone no longer needs it.
This matters because many real-world WordPress vulnerabilities become dangerous only when a low-privilege user can do something they shouldn’t. Wordfence’s report notes Contributor-level access was the most common access requirement to exploit vulnerabilities in 2024 (34%).
So, roles aren’t “organizational,” they’re defensive controls.
WordPress roles, explained like you actually run a website
WordPress ships with six pre-defined roles: Super Admin, Administrator, Editor, Author, Contributor, Subscriber. Each role maps to a set of capabilities (fine-grained permissions like edit_posts, publish_posts, manage_options, etc.).
Let’s translate them into real-world usage:
Super Admin (Multisite only)
- Exists in WordPress Multisite.
- Has network-wide control: can manage sites, install themes/plugins across the network, and more.
- Treat this like “root.”
Rule: keep Super Admin count as low as possible (ideally 1–2 humans).
Administrator
- Full control of a single site: users, settings, plugins/themes, and (often) file edits.
- If compromised, game over.
Best practice:
Create one admin account for “admin-only tasks,” and do daily work using a lower role.
Editor
- Manages content: edit/publish others’ posts/pages, moderate comments.
- Usually the highest role your content team needs.
Use for: content managers, lead editors.
Author
- Can publish and manage their own posts.
- Can upload media (depending on configuration).
Use for: trusted writers who publish directly.
Contributor
- Can write but cannot publish (submits for review).
- Great for reducing risk from guest writers.
Use for: guest authors, junior writers.
Subscriber
- Can log in and manage their profile.
- Useful when you need accounts for membership, restricted content, or commenting.
Use for: members/customers (with plugins handling extra permissions).
A simple least-privilege setup that works for most sites
If you want a baseline that’s hard to mess up:
- One “break-glass” admin account
- Strong password + MFA
- Used only for plugin installs, settings changes, emergencies
- Not used for daily publishing
- Editors for content leaders
- They can publish and manage content, not change site settings
- Authors for trusted writers
- Only if they truly need direct publishing
- Contributors for everyone else
- Draft → review → publish flow
- Remove accounts aggressively
- If someone leaves or a contractor finishes, disable/delete immediately
Pro tip: Make “Administrator” a job role, not a default.
Go beyond roles: capabilities and custom roles (carefully)
Roles are bundles of capabilities. WordPress lets you add/remove capabilities using functions like add_cap() and remove_cap().
In practice, most site owners manage custom permissions using reputable plugins (e.g., Members, User Role Editor). If you do this:
- Prefer removing capabilities rather than adding new powerful ones.
- Don’t invent “almost-admin” roles casually (they become confusing and risky).
- Document what you changed—future you will forget.
Lock down authentication (because passwords get attacked constantly)
Wordfence’s report is blunt: 55+ billion password attacks blocked in 2024. You can’t control the internet, but you can make password attacks pointless.
1) Use passphrases, not “complex” short passwords
NIST recommends a minimum of 8 characters, and recommends systems permit at least 64 characters (passphrases).
Practical rule:
Use a password manager and long passphrases everywhere, especially for admin accounts.
2) Turn on MFA for admin and editors (minimum)
CISA summarizes it simply: MFA makes you significantly more secure by requiring a second factor.
Do this today:
- MFA for all admin accounts
- MFA for editors and anyone with elevated privileges
- Store recovery codes securely
3) Add brute-force throttling (rate limits)
Whether through your host/WAF or a security plugin, rate limiting matters. Wordfence’s own guidance includes blocking brute force after a defined number of failed attempts (example: 20).
4) Stop sharing logins
Shared admin passwords are a silent disaster:
- No accountability
- Hard to revoke
- One compromise spreads everywhere
Give each person their own account, always.
WordPress hardening that actually moves the needle
Hardening is defense-in-depth: if one layer fails, another stops the blast radius.
1) Keep core/plugins/themes updated (and delete what you don’t use)
This is boring, but it’s crucial work.
Wordfence found plugin vulnerabilities accounted for 96% of disclosed vulnerabilities in 2024. Fewer plugins = smaller attack surface.
Also, WordPress supports automatic background updates and breaks them down into core, plugins, themes, and translations.
A sane update policy:
- Enable auto-updates for minor core security releases
- For plugins/themes: auto-update only trusted ones, or update weekly with a quick staging check
- Delete inactive plugins/themes (don’t just deactivate)
2) Disable the built-in file editor (huge win)
If an attacker gets an admin login, the dashboard theme/plugin editor is often the fastest path to code execution.
WordPress explicitly recommends disabling it via:
define( ‘DISALLOW_FILE_EDIT’, true );
This removes file editing capabilities from the dashboard.
3) Use correct file permissions (and protect wp-config.php)
WordPress’s file permissions guidance is clear, including a specific warning that leaving wp-config.php too permissive is hazardous.
In a common secure setup (especially with suEXEC / PHP-FPM style isolation), WordPress notes:
- Directories: 755 or 750
- Files: 644 or 640
- wp-config.php: 440 or 400
Also: never use 777. Ever.
4) Protect /wp-admin/ (especially for small teams)
WordPress hardening guidance suggests adding an extra layer such as server-side password protection (e.g., BasicAuth) to /wp-admin/, creating a second barrier before WordPress even loads.
If you can also restrict by IP (static office IP, VPN exit IP), even better.
5) Consider XML-RPC exposure (don’t break what you rely on)
XML-RPC can be abused in brute-force and other attacks, but some tools rely on it (Jetpack, mobile app, integrations).
A WordPress support discussion notes that disabling XML-RPC generally shouldn’t affect core updates/features, but can impact Jetpack/mobile apps and some third-party services.
Practical approach:
- If you don’t use it: block or disable it
- If you do use it: protect login endpoints with rate limiting + MFA and monitor traffic
6) Refresh security keys/salts after incidents (and periodically)
WordPress uses keys/salts to secure cookies and sessions. WordPress developer documentation explains salts are created using secret keys located in wp-config.php and also in the database.
When to rotate keys:
- Immediately after any suspected compromise
- After removing unknown admin users
- When migrating environments where config files were exposed
7) Add a WAF (plugin-level or edge-level)
WordPress hardening documentation calls out:
- Plugin firewalls (WordPress-level)
- Server WAFs (like ModSecurity)
- Reverse-proxy services (e.g., Cloudflare, Sucuri)
Rule of thumb:
An edge/WAF can block a lot of noise before it hits PHP, and it often improves performance too.
Don’t forget the “other” least privilege: hosting + database access
WordPress roles are only one part. Apply least privilege to:
Hosting panel access
- Only site owners should have full hosting control panel access
- Use separate accounts for developers (time-limited if possible)
- Enable MFA at the host level
Database user permissions
Your WordPress database user does not need global admin privileges across the DB server.
- Give it access only to the WordPress database
- Restrict permissions to what WordPress requires (your host can advise)
- Never reuse DB credentials across sites
API keys and integrations
Zapier, SMTP, backups, CDN, analytics—treat these as privileged.
- Unique keys per integration
- Revoke unused keys
- Rotate keys after staff changes or incidents
Monitoring + backups: the difference between “annoying” and “catastrophic”
Security is also recovery. Sucuri’s data point about backdoors on compromised sites (49.21%) shows why cleanup without visibility is fragile.
Minimum monitoring to run a serious WordPress site
- Uptime monitoring
- File change detection (core files, plugin directories)
- Login alerts for admin accounts
- New user creation alerts
- Firewall logs (even if you don’t read them daily)
Backup rules that prevent heartbreak
- Automated daily backups (more frequent for ecommerce)
- Offsite storage (not on the same server)
- Keep multiple restore points
- Test restores quarterly (seriously)
A backup you’ve never restored is just a comforting story.
A practical “1-hour WordPress security sprint” checklist
If you want a fast, high-impact pass:
In the first 10 minutes
- Remove unused admin accounts
- Downgrade roles (Admin → Editor where possible)
- Turn on MFA for admins/editors
Next 20 minutes
- Update WordPress core + plugins + themes
- Delete inactive plugins/themes
Next 15 minutes
- Add DISALLOW_FILE_EDIT
- Confirm file permissions align with WordPress guidance (especially wp-config.php)
Last 15 minutes
- Enable brute-force rate limiting / WAF rules
- Confirm backups are running and offsite
- Set alerts for new admin user creation
That’s not “perfect security.” But it’s a massive improvement.
Final mindset: secure by design, not by panic
WordPress security gets easier when you stop treating it as a giant mystery and start treating it as:
- Access control (least privilege)
- Maintenance (updates + remove unused software)
- Hardening (disable risky features, correct permissions, WAF)
- Resilience (backups + monitoring)
And remember: not all vulnerabilities are equal. Wordfence notes that only 7.4% of vulnerabilities disclosed in 2024 were considered “high-threat”, and many are low risk depending on auth and interaction requirements.
So don’t panic, just build layers.






