WordPress Security Guide

WordPress Security Best Practices That Hold Up Over Time

Most WordPress security advice is a list of settings. What actually keeps a site safe is a small number of controls applied consistently, in the right order, and reviewed when the site changes.

Written by Rana Shahwaiz Aslam, CEH Certified, Xequent. Updated August 2026.

  • CEH Certified
  • Top Rated Plus on Upwork
  • 100% Job Success
  • Handled directly, not outsourced
Priority order

The four things that prevent most compromises

Across real incidents, the same small set of failures shows up again and again. Fixing these four removes the large majority of realistic attack paths, and everything else in this guide is refinement on top of them.

  1. Keep components current. Outdated plugins and themes with public exploits are the most common entry point by a wide margin. This is not a preference, it is the control.
  2. Protect administrator accounts. Unique passwords, two factor authentication, and no shared logins. Credential reuse is the second most common entry point.
  3. Apply least privilege. Most people who have administrator access do not need it. Editor or author covers the actual job for the majority of content roles.
  4. Keep working, tested backups off the server. Not on the same hosting account, and restored at least once so you know they work.

If time or budget is limited, stop reading after this section and do these properly. They outperform any plugin purchase.

Update policy

Build an update process you will actually follow

Everyone agrees updates matter. Sites still run months behind, because the process is either fully manual and gets deprioritised, or fully automatic and broke something once.

A workable middle: enable automatic updates for WordPress core security releases and for plugins you trust and have tested. Handle major version updates for anything touching checkout, payments, forms or membership on staging first. Review the update queue on a fixed schedule so it never becomes a six month backlog.

Reduce what you have to maintain

Every installed plugin is code you are responsible for. Delete anything deactivated but still present, because inactive code is still on disk. Replace abandoned plugins with maintained alternatives before they become the incident. A site with eighteen plugins is meaningfully harder to keep secure than the same site with nine.

Watch for disclosed vulnerabilities

Subscribe to a WordPress vulnerability feed or use a tool that checks your installed versions against one. The window between public disclosure and mass automated exploitation is frequently measured in hours, and knowing you are affected on day one changes the outcome.

Access control

Administrator access is the actual perimeter

Nearly every serious WordPress compromise ends with the attacker holding an administrator account, whether they exploited their way to one or simply logged in. Treating that account as the perimeter changes what you prioritise.

  • Two factor authentication on every administrator, with no exceptions for the busy person.
  • Unique passwords per account, generated and stored in a password manager, never reused from another service.
  • Individual accounts, never a shared login, so that logs and revocation both work.
  • A removal process, so accounts for former staff, agencies and contractors are deleted the week they stop working with you rather than three years later.
  • Quarterly review of who holds administrator, which usually removes several people.
  • Rate limiting on the login path so brute force attempts are throttled before they reach PHP.

The last one is worth doing at the edge rather than in a plugin, because a request blocked at the edge never consumes origin resources. The WAF guide covers the rule pattern.

Configuration

Hardening that is worth the effort

Hardening has a long tail of marginal tweaks. These are the ones with real return.

  • Disable the dashboard file editor. It turns any administrator compromise into immediate code execution. One constant in wp-config.php.
  • Correct file permissions. Files at 644, directories at 755, wp-config.php tighter. Nothing should be world writable.
  • Block PHP execution in uploads. This neutralises an entire class of upload based attacks.
  • Restrict or disable XML-RPC unless a service you use depends on it, since it is heavily abused for brute force amplification.
  • Use a unique database prefix and a dedicated database user per site, so one compromised site on shared hosting does not reach the others.
  • Keep PHP on a supported version. Unsupported PHP means unpatched interpreter bugs regardless of how clean your WordPress is.
  • Serve everything over HTTPS with HSTS, and set sensible security headers.
Recovery

Backups are a security control, and most are not tested

Backups are what caps the damage when everything else fails, and they are the control most likely to fail silently when it is needed.

Store copies off the hosting account, so a compromise or suspension of the account does not take the backups with it. Keep enough history to reach a point before a compromise you have not noticed yet, which realistically means at least thirty days rather than the last three. Back up files and database together so the restore is coherent. Then actually perform a test restore to a staging environment, because an untested backup is an assumption.

One caution: restoring a backup fixes the symptom, not the cause. If the vulnerable component is still installed after the restore, reinfection follows quickly. The cleanup guide explains why entry point analysis has to happen either way.

Visibility

Monitoring, so you are not told by a customer

The gap between compromise and detection is where most of the cost accumulates: lost rankings, blocklisting, spam sent under your domain, and orders that never completed.

Four monitors cover the realistic failure modes. File integrity monitoring with alerts catches unexpected changes within minutes. Uptime and content monitoring catches defacements and redirects. Search Console catches what Google sees before you do, including cloaked spam. Login monitoring catches credential attacks in progress.

Set these up once, make sure the alerts reach a person, and review them. An alert routed to an unread inbox is not monitoring. Detail on detection technique is in the scanning guide.

Edge layer

Where Cloudflare fits in the program

Edge protection is genuinely valuable and consistently oversold. What it does well is reduce volume: automated scanning, brute force attempts, scraping and application layer floods can be filtered before they consume origin resources. On a busy site that is the difference between a stable server and one falling over under noise.

What it does not do is fix the application. A WAF does not patch your plugin, remove a malicious administrator account or repair file permissions. Sites that treat Cloudflare as the security program tend to be well protected against generic scanning and wide open to the specific vulnerability they have.

The sensible order is application first, edge second. Once the site is maintained and hardened, add WAF rules matched to your endpoints, rate limiting on login and API paths, and bot controls tuned to your traffic. In that order, each layer adds real coverage instead of hiding a gap.

Get this implemented

Where this becomes an engagement

Most of this is work a competent team can do internally. These are the parts businesses usually hand over.

Security Hardening

A one time pass across accounts, permissions, configuration, plugin exposure and security controls, with documentation of every change.

Explore this service →

WordPress Maintenance

Updates, vulnerability checks, backup verification and monitoring on a schedule, so the program does not drift.

Explore this service →

Managed Security

Hardening plus ongoing monitoring and response, for sites where downtime or a data incident is expensive.

Explore this service →
Frequently asked questions

WordPress security questions

Is a security plugin enough on its own?

No. A security plugin adds useful visibility and some blocking, but it does not update your components, manage who has administrator access, verify your backups or protect the hosting account. Treat it as one instrument on the dashboard, not the engine.

Which security plugin should I use?

The right answer depends on what else is in place. A site already behind a properly configured WAF does not need a second traffic filter competing with it, and would benefit more from file integrity monitoring. A site with no edge protection has different priorities. Choose based on the gap you actually have.

Should I hide the WordPress version and login URL?

These are obscurity measures, not security controls. They reduce noise from unsophisticated automated scanning, which has some value, but they do not stop a targeted attacker and they should never be counted as protection. Do them after the items in this guide, not instead of them.

How often should WordPress be updated?

Security releases should be applied within days. Feature releases can follow a monthly cycle on a staging environment first. The failure mode to avoid is deferring updates for months because a previous update broke something, since that is precisely how sites end up running a component with a public exploit.

Do I need two factor authentication if I have a strong password?

Yes. A strong password protects against guessing, not against reuse, phishing or a credential dump from an unrelated service. Two factor on every administrator account is the single highest value control relative to the effort it takes.

Does Cloudflare replace WordPress security?

No. Cloudflare filters what reaches the origin. It does not patch a vulnerable plugin, remove a malicious administrator account, or fix file permissions. Edge protection reduces volume and buys time, and it is most effective on a site that is already maintained.

Explore the Related Security Service

Use this guide alongside the relevant commercial service: security services, WordPress security, Cloudflare security, and click fraud prevention.

Direct help

Need this implemented on your website?

Talk directly with Xequent about WordPress security, Cloudflare protection or click-fraud controls.

Direct Expert Contact

Speak directly with Rana Shahwaiz Aslam

Xequent is operated by Rana Shahwaiz Aslam. The current professional profile shows 100% Job Success, Top Rated Plus, 37 jobs, and 851 hours on Upwork, with pricing scoped to the engagement rather than an open-ended hourly meter. Rana's profile title identifies him as CEH Certified and focused on managed Cloudflare security and cybersecurity.

WhatsApp RanaEmail