News
The Essential Guide to WordPress Security
Introduction: Why WordPress security matters
WordPress is hugely popular — it powers a very large proportion of the web. That popularity brings both strength and risk. On the positive side, there is a vibrant ecosystem of plugins, themes, developers, and support. On the downside, it is a prime target for attackers, because vulnerabilities in plugins, themes or misconfigurations can be exploited on millions of sites.
Some high-level statistics illustrate the scope of digital threats, especially in the UK:
- According to the UK Government’s Cyber Security Breaches Survey 2025, UK businesses experienced approximately 8.58 million cyber crimes (of all types) in the past 12 months, including about 680,000 non-phishing cyber crimes. The mean cost per business (excluding zero-cost incidents) was about £1,970. GOV.UK
- Another survey indicates that about 43% of UK businesses and 30% of charities reported a cyber breach or attack in the past year. trustwave.com
- On the WordPress side, a Kinsta/Wordfence stat is frequently cited: over 500 WordPress sites are hacked every day. How-To WP
- Also, of all the vulnerabilities found in the WordPress ecosystem, just 0.2% were in the WordPress core itself; most vulnerabilities lie in themes or plugins. Kinsta®+1
- SentinelOne reports that ~90% of WordPress security issues originate in plugins, ~6% in themes, ~4% in core. SentinelOne
These numbers should shake you awake: your WordPress site is neither inherently “safe by default” nor too small to be worth protecting. In almost every case, security is a layered strategy — no single fix suffices. Below is an “essential guide” covering ten (plus bonus) pillars you should adopt.
1. Choose secure hosting & environment
Your hosting provider and server environment are the foundation of security. Even the best WordPress hardening will struggle on a compromised server.
What to look for in a hosting provider
- Managed WordPress hosting: Providers such as Kinsta, WP Engine, SiteGround, WPX and others often include proactive security, firewalls, malware scanning, automatic updates, backups and staging environments.
- Isolation & containerization: Don’t let your site share with hundreds of others on the same account without isolation.
- Up-to-date server software: Nginx or Apache with latest patches, secure versions of PHP (8.1, 8.2, etc), supported MySQL/MariaDB versions.
- Web Application Firewall (WAF) presence, or capability to install one.
- Secure control panels: cPanel, Plesk, or proprietary dashboards should be access-controlled (with 2FA ideally).
- Backups and disaster recovery: The host should offer off-site backups and easy restore options.
If your host doesn’t offer these, consider migrating to one that does. Many security breaches are used via server misconfiguration or vulnerability at the hosting level.
A well-chosen host reduces your burden: if their server is frequently updated, patched, well configured, it removes large swathes of attack surface.
2. Harden WordPress core, updates & version control
Keeping WordPress core, plugins and themes updated is one of the most effective defences.
Automatic updates, but safely
WordPress supports “automatic background updates” for minor core releases, but many administrators disable this by default. Enabling it (or managing updates carefully) helps you stay current with security patches. Avoid disabling core updates permanently.
Version control methods
- Use a staging or development site to test updates before pushing to production.
- Use version control (Git) so you can rollback if an update causes a conflict or breakage.
- Don’t rely only on manual backups — combine versioning, backup, and rollback strategies.
Remove unused code
- Delete unused themes or plugins completely (don’t just deactivate them).
- Remove default themes if you don’t use them.
- If there are “demo/import” files or sample data, purge them.
Limit version visibility
Some attacks probe by detecting your WordPress version in headers or generator tags. You can hide or obfuscate those:
- Remove the <meta name=”generator”> tag.
- Disable or filter out version visibility in scripts.
- Use security plugins to mask version strings.
But note: this is obfuscation, not real security — it only helps against automated scanning.
3. Strong authentication & access control
Even a well-secured site can be compromised by weak credentials or excessive privileges.
Strong passwords & 2FA
- Enforce strong passwords: a mix of uppercase, lowercase, numbers, symbols, length (12+ characters ideally).
- Use a password manager to generate and store complex passwords.
- Enable two-factor authentication (2FA) (e.g. via authenticator apps, SMS, hardware keys). Plugins like Two Factor, WP 2FA, or many security suites support this.
- Where possible, restrict login attempts or use IP whitelist/blacklist for admin pages.
Principle of least privilege (role management)
- Only give users the roles they absolutely need (Administrator, Editor, Author, Contributor, Subscriber).
- Avoid using Administrator for day-to-day content editing.
- Use a dedicated “maintenance” or “developer” account instead of shared generic credentials.
- Revoke or delete accounts of ex-employees or contractors promptly.
Change default login URL
- The default WordPress login URL is yourdomain.com/wp-login.php or yourdomain.com/wp-admin. Many attacks probe this.
- Use plugins or custom rewrites to change or mask the login URL. (Be cautious — ensure you don’t lock yourself out.)
Session management, timeouts and IP restrictions
- Configure auto-logout after inactivity (especially for admin accounts).
- Limit login access by IP address (if feasible) for wp-admin.
- Monitor active sessions and allow forced logout of idle or suspicious sessions.
4. Use a Web Application Firewall (WAF) and security plugin
Even with good practices, attacks will happen. A firewall and security plugin act as a layer of defence.
Web Application Firewall
A WAF filters and inspects incoming web traffic and blocks malicious requests (e.g. SQL injection, XSS, brute force). There are two broad types:
- Cloud / DNS-based WAF (e.g. Cloudflare, Sucuri, CloudFront WAF). These operate before traffic hits your server.
- Plugin / local WAF (e.g. Wordfence, iThemes Security). They inspect after hitting WordPress PHP but can still block attacks.
Many managed hosts integrate a WAF at the server level. Use a WAF that includes rule updates, zero-day protection, and custom rule settings.
Security plugin features
Choose a robust security plugin (or combination) that offers:
- Malware scanning & monitoring (file integrity checks)
- Login hardening (limit login attempts, IP blocking, login alerts)
- 2FA integration
- Firewall or firewall hooks
- Audit logging (record who did what when)
- Automatic recommendations and fixes
- Blacklist / block rules
Popular choices: Wordfence, Sucuri, iThemes Security, All In One WP Security & Firewall, MalCare, Shield.
Configure alerts & logs
- Enable email/Slack alerts for login failures, new user registration, plugin/theme file changes.
- Periodically review audit logs.
- Send alerts to an offsite email or monitoring dashboard so a breach of your site doesn’t suppress its own alerts.
5. Secure configuration: files, database & server settings
This is more technical, but the payoff is high.
wp-config.php protection
- Move wp-config.php one directory up (if server structure allows) so it’s not directly accessible.
- Restrict file permissions (e.g. 400 / 440) where possible.
- Define salts and keys (AUTH_KEY, NONCE_KEY, etc). Use [WordPress.org secret key generator] to produce random ones.
- Disable file editing from the Dashboard:
define('DISALLOW_FILE_EDIT', true);
define('DISALLOW_FILE_MODS', true);
- Limit auto-load size and memory settings with WP_MEMORY_LIMIT and WP_MAX_MEMORY_LIMIT.
Database hardening
- Change the default table prefix wp_ to something custom (e.g. wp7f2_) when installing, or use a plugin to migrate it.
- Restrict database user privileges: GRANT only SELECT, INSERT, UPDATE, DELETE, and not DROP or ALTER unless strictly needed.
- Use strong DB user passwords.
- Ensure wp_options table autoloaded data is not overloaded (avoid giant autoload rows).
File & directory permissions
- WordPress recommends 755 for directories, 644 for files. Avoid 777 at all costs.
- For critical files (such as .htaccess, wp-config.php), you can apply stricter permissions (e.g. 640 or 600) if the server supports it.
- Prevent directory listing by disabling Options +Indexes in .htaccess or server config.
HTTPS only
- Force HTTPS on the entire site (not just the checkout or login). Use an SSL/TLS certificate (Let’s Encrypt, commercial ones).
- Enable HTTP Strict Transport Security (HSTS) header to force browsers to always use HTTPS.
- Ensure you don’t serve any content (images, scripts, styles) over HTTP (mixed content causes warnings).
Secure server setup
- Disable unused PHP modules and features (e.g. xmlrpc if not used).
- Ensure open_basedir, disable_functions and safe mode settings are applied.
- Restrict direct access to wp-includes and wp-content/uploads via rules in .htaccess or Nginx configuration (block php execution where not needed).
- Use mod_security rules or Nginx equivalent.
- Limit server access (SSH, FTP) via keys, and disable root login (especially for VPS).
6. Backup and restore strategy (you must assume you’ll be compromised)
No security plan is perfect. Having fast and reliable backups and tested restore processes is essential to resilience.
What makes a good backup system
- Frequency: backups should be frequent (nightly at minimum, possibly hourly for high-change sites).
- Offsite storage: store backups away from the same server — Amazon S3, Google Cloud Storage, Dropbox, remote FTP, or dedicated backup services.
- Full & incremental: perform full backups plus incremental deltas, so storage use is efficient.
- Database + files: back up everything (DB, uploads, plugins, themes, configuration).
- Retention: keep a retention of multiple versions (e.g. 7–14 days, or more for critical sites).
Testing restores
- Regularly test restore processes (on staging) to make sure backup files are valid.
- Document the steps and ensure minimal downtime in the event of recovery.
- Automate restores where possible (scripts, wp-cli restore commands).
Backup plugins & solutions
- UpdraftPlus, BackupBuddy, Duplicator, VaultPress, Jetpack Backup.
- Many managed hosts provide backup as part of their package — but verify retention, offsite storage, and ease of restoration.
7. Malware scanning, monitoring & intrusion detection
Catching attacks early reduces damage and downtime.
File integrity monitoring (FIM)
- Use checksums or hashes to detect changes to core files, themes or plugins.
- Many security plugins include file change detection.
- If a critical file was changed, you should be alerted immediately.
Malware / signature scanning
- Periodic scans for malicious code, injected scripts, backdoors or PHP shells.
- Use tools like Sucuri, Wordfence scanning, MalCare, VirusTotal, or external scanners.
- Some host providers scan server-wide for malware; still, you should augment with site-level scans.
Intrusion detection & abnormal behaviour monitoring
- Monitor inbound requests (requests per second spikes, strange user agents, repeated failed logins).
- Use web server logs and monitoring tools (Logwatch, Splunk, ELK, external SIEM) to flag anomalies.
- Monitor outgoing traffic too: if your site is sending data to unknown IPs, that’s suspicious.
Security notification & alerting
- Email, SMS, Slack, or webhook alerts for critical events.
- Limit the number of alert recipients — avoid alert fatigue.
8. Manage plugins, themes and third-party code carefully
Because most WordPress vulnerabilities come via plugins or themes, this is a critical domain.
Audit and reduce
- Perform a regular audit: which plugins/themes you are using, whether they are essential.
- Remove or replace plugins with poor update history or reputation.
- Avoid “plugin bloat” — fewer plugins means fewer risks.
Choose high-quality, maintained code
- Prefer well-known plugins with high download numbers and good reviews.
- Check the plugin’s update history (frequent updates, prompt security patches).
- Read changelogs, support threads for vulnerability reports.
- Consider paying for premium, actively maintained plugins over free, abandoned ones.
Use version control / staging
- Test new plugin or theme updates on a staging environment before deploying to production.
- Use code review where possible.
- Use plugin locking or version pinning where you freeze a plugin until you can test its update.
Isolate dangerous code / sandbox
- If you must use a risky or third-party plugin, isolate it — for instance, via iframes, sandboxed environments, or proxying.
- Use least privileges: limit its access to only what it needs.
Monitor for known vulnerabilities
- Subscribe to vulnerability databases (WPScan, CVE lists, plugin security advisories).
- Use automated vulnerability scanning tools against your site to detect outdated or flawed plugins.
9. Limit exposure: reduce attack surface and entry points
Every extra endpoint or open vector is an opportunity for an attacker.
Disable or restrict XML-RPC & REST API
- XML-RPC is often exploited for brute force or pingbacks. If your site doesn’t need it, disable it.
- Use plugins or functions to block unauthorised REST API access except to required endpoints.
Disable directory listings & remove sample files
- Prevent directory indexing (Options -Indexes in Apache, autoindex off in Nginx).
- Remove sample files, readme.html, license.txt, and other documentation files which may reveal version information.
- Restrict access to wp-content/uploads, wp-includes, etc.
Disable or restrict PHP execution in uploads
- Within wp-content/uploads, block execution of PHP files via .htaccess or Nginx rules.
- Only allow serving static assets there (images, pdf, etc).
Limit the use of admin Ajax, cron, and REST endpoints
- If you don’t use certain Ajax endpoints, disable them or restrict access.
- Replace WP-Cron with a real cron job (disable DISABLE_WP_CRON and schedule cron on the server).
- For heavy API usage, throttle rate or IP whitelist.
Remove or disable unused features
- Turn off or disable themes or plugins parts you don’t use (widgets, embeds, etc).
- Disable file uploads if not needed.
- Disable pingbacks, trackbacks or comment features if your site doesn’t use user comments.
10. Incident response plan, disaster recovery & post-breach steps
Even a well-secured site can fall victim. What matters is how you respond.
Prepare an incident response plan
Before anything happens, define:
- Contact list: who will respond (developers, sysadmins, host, security firm).
- Checklists: initial isolation steps, forensic log collection, backup restore, site health checks.
- Communication plan: how you notify users, stakeholders, and customers.
- Legal/regulation steps: GDPR reporting if personal data was exposed, notifying regulatory bodies.
- Postmortem & lessons: after recovery, review what went wrong, update practices, close gaps.
Immediate steps when a breach is discovered
- Take the site offline or put in maintenance mode (if the site is being actively exploited).
- Disconnect from external integrations where possible.
- Preserve logs, server and file system snapshots.
- Scan for malware and backdoors.
- Use backups to revert to a clean state.
- Change all passwords (admin, database, FTP, hosting).
- Remove unused plugins/themes—especially any that were vulnerable.
- Update all core, plugin, theme files.
- Re-enable and test security hardening measures.
- Monitor carefully and watch for further anomaly.
Post-recovery monitoring
- Keep security logs and alerts active for months after a breach.
- Run periodic vulnerability scans.
- Consider hiring an external security audit or pen test.
Bonus: Ongoing security practices & checklist
To keep your WordPress site secure over time, here’s a checklist and set of best practices:
- Regular audits: monthly or quarterly audits of plugins, themes, user accounts, logs.
- User training: if you have content contributors or clients, train them in password hygiene, phishing awareness, 2FA usage.
- Stay informed: monitor WordPress security news, mailing lists, vulnerability disclosures.
- Minimal plugins: fewer plugins, only quality ones.
- Two-stage environment: use staging environments for development, do not work directly on production.
- Version control & CI/CD: deploy via automated pipelines, test before deploying.
- Security headers: enable Content Security Policy (CSP), Referrer Policy, X-Frame-Options, X-Content-Type-Options, Strict-Transport-Security.
- Limit REST API & admin-ajax calls.
- Rate limit requests: throttle/rate-limit login, search, other endpoints to slow automated attacks.
- Geo-blocking (if valid): block suspicious country traffic if your site only serves UK or EU.
- SSL/TLS hardening: use modern ciphers, disable weak protocols (TLS 1.0/1.1), test with SSL Labs.
- DNS security: enable DNSSEC, limit zone access, use secure DNS providers.
- Monitoring & alerts: always keep alerting turned on — login failures, file changes, spikes, etc.
- Backup & restore practice: not just running backups but testing restores regularly.
Challenges, trade-offs & myths
Performance vs Security
Sometimes security features (firewalls, scanning, logging) impose performance overhead. Mitigate this by caching, selective logging, offloading scanning, or combining security solutions with performance strategy.
False sense of security
No stack is 100% secure. Obfuscation (hiding version numbers) or hiding login URLs are not true defences — they only deter low-skilled automated attacks. Always rely on proper security layers (authentication, firewalls, patching).
Complexity & cost
Some security measures (WAFs, audits, continuous monitoring) cost time or money. But the cost of a breach — in reputation, repair, data loss, downtime, regulatory fines — is often far higher.
Human factor
A majority of security breaches come from social engineering, phishing, weak passwords or compromised credentials. Technical safeguards fail if users’ credentials are compromised.
Case study & anecdote: the British Library attack
An instructive real-world example in the UK: in late 2023, the British Library was hit by a ransomware attack allegedly by the hacker group Rhysida. Around 600 GB of data were exfiltrated, and payment demands made. Some services remained offline for months, and recovery reportedly cost millions of pounds. Wikipedia
This incident illustrates how even large, established institutions with significant resources can be severely impacted by security lapses. Websites, archives, public services — all are at risk, reinforcing that security is never optional.
Summary & next steps
WordPress security is not just a one-time setup, but a continuous discipline. Here’s a concise summary of what you should prioritise:
- Secure hosting & environment
- Keep WordPress core, plugins, themes updated
- Strong authentication (passwords + 2FA) and access control
- Deploy a WAF and security plugin with monitoring
- Harden configuration: wp-config, database, file permissions
- Backup & restore strategy + regular testing
- Malware scanning, monitors and intrusion detection
- Manage third-party code carefully (plugins, themes)
- Reduce exposure and disable unnecessary features
- Have an incident response plan & post-breach strategy
Combine those with regular audits, user education, and staying current with vulnerabilities and threat intelligence.
















The Ultimate Social Media Guide
With the ever-growing power of social media, we use the latest techniques, video, and animation software to craft eye-catching social media assets that make your brand pop. Our designers, wielding Adobe Creative tools, create distinctive animations and graphics to illuminate your brand story and highlight your products or services. Want a unique design? No problem – we also offer bespoke designs to match your brand aesthetic.