Most WordPress security advice arrives as a shopping choice: install a security plugin, or move to a host that “handles security”, or put the site behind a firewall service. People then treat the three as rivals and pick one. That framing is the first mistake. Server-level controls, host platform controls and plugin controls are not competing products. They are controls that run in different places, and where a control runs decides almost everything about it: what it can see, when it can act, what it costs on every request, and whether it still works on the day something goes wrong.
Here is the idea the rest of this comparison hangs on. A control can only act on what it can see, and it can only be trusted as far as it is independent of the thing it protects. A WordPress security plugin is PHP code that runs inside the same PHP process, as the same operating system user, with the same file access as the site it guards. That gives it a huge advantage, because it knows who is logged in, which role they hold, which nonce was submitted and which plugin function is about to run. It also gives it a structural weakness, because an attacker who gets code running on the site is standing in the same room as the guard. A firewall at the DNS or CDN edge has the opposite profile. It sits outside everything and survives a compromise of your server, but it sees requests as text and has no idea whether a particular POST is a logged-in editor doing their job or a subscriber abusing a missing capability check.
Neither vantage point is better. They are complementary views, and the interesting questions are practical ones. Which jobs does a plugin do badly or not at all, such as closing ports, isolating one site from its neighbours or patching the operating system? Which jobs does a server do badly, such as understanding a WordPress login, a nonce or a plugin version? Where do the layers duplicate each other so you pay twice, and where do two active layers fight and lock out your own customers or your own team? What does a managed host really include when the sales page says “security”? And in what order should a one-person blog, a WooCommerce store, a membership site and an agency with forty client sites assemble the layers?
This comparison works through those questions one layer at a time: the edge, the network and host firewall, the web server and PHP configuration, file ownership and isolation, the endpoint firewall inside WordPress, vulnerability intelligence and virtual patching, patching across layers, scanners and login hardening, then performance, false positives and duplication. It then sets out who owns what between you, your host and a plugin, and ends with a layered baseline by site type and a decision rule for placing any new control.
A few ground rules. WPresident has not benchmarked these products for this post, so you will not find detection rates or speed numbers. Product capabilities are described in general terms and change over time, so verify specifics on the vendor page before you rely on them. Nothing here is legal or compliance advice; if a regulation or a payment standard applies to you, treat this as orientation and check the actual requirement. And one warning about order of operations: use detect-only or logging modes before blocking modes, and keep a way back in that does not depend on the site itself, because the most common security incident on a WordPress site with several layers is a legitimate administrator locked out by one of them.
Key points
- Where a control runs decides what it can see: the edge sees traffic, the server sees files, ports and processes, and only code inside WordPress sees users, roles and nonces.
- A plugin shares a process and file permissions with the site it protects, so a code-execution flaw can often disable it; put controls that must survive a compromise outside WordPress.
- An edge firewall is only as good as your origin lockdown: if attackers can reach your server address directly, the proxy protects nothing.
- File ownership and per-site isolation limit the blast radius of a breach more than any scanner does, because PHP should not be able to rewrite its own plugin code.
- Virtual patching and vulnerability feeds buy time between disclosure and your update, but they are a bridge to the update and never a substitute for it.
- Duplicate layers waste resources and cause lockouts, so every blocking control needs a detect-only trial, a real-IP check and a way back in.
- Baselines scale with exposure: a brochure site needs edge filtering, updates, two-factor login and tested backups, while stores and membership sites add rate limits, staged updates and application-aware rules.
Where a control runs decides what it can see
Every security control answers two questions before it does anything useful: what can I observe, and what can I change? Placement answers both. Picture a request travelling toward your site and a file sitting on your disk, and ask who gets a look at each one.
At the outermost position, a DNS-level or CDN firewall sees every HTTP request before your server does: the IP address, the headers, the path, the query string, usually the body, and the pattern of requests over time. It cannot see your disk, your processes or your database. Below that, a network firewall at the host or cloud provider sees packets, ports and addresses, and knows nothing about WordPress. The web server and PHP runtime see the full request plus the operating system context around it: which user the process runs as, which files it may touch, how much memory it may use. WordPress core and its plugins sit above that and see something none of the lower layers can: meaning. This user is logged in as an editor. That nonce is valid for this action. This call saves a post. That function is about to write to the options table.
That difference in meaning is why neither side can replace the other. A request that exploits a missing capability check in a plugin often looks, on the wire, exactly like a legitimate request from a logged-in user, so an edge firewall waves it through because nothing in the text is malicious. Equally, a plugin cannot reliably close port 3306 to the internet, stop one site on a shared machine from reading another site’s files, or patch a vulnerable system library. Those are server facts, and a plugin has only the permissions of the account it runs as.
Use three tests when you evaluate any control. First, vantage: what does it see, and what is invisible to it? Second, independence: if an attacker gets code running inside WordPress, does the control survive? Third, cost: what does it spend on each request, and who pays, you or the visitor waiting for the page? A control that sees a lot, survives compromise and costs nothing does not exist. Mostly you are trading context for independence, and the way out is to combine layers rather than choose one.
The figure lists the layers from the outside in. Read the order two ways: as the path a request travels, and as a ladder of blast radius. The further out a control sits, the less an attacker who compromises something further in can do to it.
Layers from the visitor inward
Edge firewalls: what a DNS-level WAF sees and what it misses
An edge firewall works as a reverse proxy. You change DNS records or nameservers so that your domain resolves to the provider’s network instead of your server. Visitors connect to the provider, the provider inspects the request, and only requests that pass are forwarded to your origin over a separate connection. Cloudflare, Sucuri’s cloud firewall and several CDN and host-integrated services work this way, with differences in plans and rule sets that you should verify on each vendor’s page.
What it does well follows from its position. It absorbs volumetric floods that would saturate your server’s connection, because that traffic never reaches you. It applies shared intelligence: an address hitting a thousand sites is recognised by the provider across all of them. It can rate limit by IP, challenge suspicious clients, block countries or networks you never serve, and apply rules aimed at common attack signatures such as SQL injection and cross-site scripting patterns. It does all of this without running a line of PHP on your server, so a modest hosting plan carries no per-request filtering load beyond the requests that get through. And because it lives outside your server, a compromised WordPress cannot switch it off from the inside. The catch is that the account controlling the edge becomes a crown jewel. Someone who takes over your edge dashboard can pause the firewall, change DNS or point your domain somewhere else, so protect that login with two-factor authentication as strictly as you protect the WordPress admin.
What it misses is context. It sees an HTTP request, not a WordPress session. It can read a cookie but cannot tell whether the session is valid for the action, whether the nonce matches or whether the user’s role may call this function. Application-layer flaws such as broken access control, where a low-privilege account calls an endpoint a plugin forgot to protect, mostly produce requests that look ordinary. Signature rules help against the noisy, well-known payloads that make up much of automated scanning. They help less against a precise exploit crafted for one plugin, unless the provider has written a rule for that exact flaw.
Edge firewalls also have blind spots unrelated to attack type. They never see traffic that bypasses them, which is the subject of the next section. They inspect encrypted traffic only because they terminate TLS, so the provider handles your visitors’ requests in readable form at the edge, a trade-off worth a conscious yes. And they cannot see your disk. A web shell uploaded through a flaw that no rule recognised is invisible to them, and so is a rogue administrator account created by a plugin bug.
Finally, plan tiers differ in which managed rule sets, custom rules and rate-limiting features are included. Read the plan details before assuming a feature exists, and confirm in the dashboard that the managed rules are switched on rather than merely available.

Origin lockdown and the real visitor IP
An edge firewall protects only the traffic that goes through it. Your origin server still has a public IP address, and if an attacker learns it they can send requests straight to it and skip the edge entirely. Origin addresses leak more easily than people expect: old DNS records from before you added the proxy, a mail server on the same address whose message headers reveal it, a subdomain left unproxied for staging or FTP, certificate transparency logs, and internet-wide scan databases that record what answers on port 443. Once the address is known, an unprotected origin turns the whole edge setup into decoration.
The fix is origin lockdown: the origin accepts web traffic only from the edge provider. There are two common ways. The first works at the network level, with a host or cloud firewall rule that allows ports 80 and 443 only from the provider’s published address ranges, which you must keep current as the provider changes them. The second is cryptographic: authenticated origin pulls or mutual TLS between edge and origin, so the origin refuses connections that cannot present the provider’s client certificate. Cloudflare documents a feature of this kind and other providers have equivalents, so verify the details with yours. A cheap sanity test is to request your site by IP address from a machine outside the allow list and confirm you get a refusal or a timeout instead of your site.
The second trap is the visitor IP. Behind a proxy, the connection your server sees comes from the proxy, so the server’s remote address holds an edge address, not the visitor’s. The real address arrives in a header such as X-Forwarded-For or a provider-specific equivalent. Every control that reasons about addresses, including rate limiting, blocklists, login throttling and plugin firewalls, will quietly use the wrong one unless it is told which header to trust. The failures are ugly in both directions. If a plugin trusts no header, it sees all visitors as a few edge addresses, and one block or one rate-limit hit can lock out your entire audience. If it trusts a header it should not, an attacker can forge the value and dodge blocks by presenting a fresh address on each request. Trust forwarded headers only when the connection really comes from your edge provider, and use the provider’s documented header.
Check your own setup in two steps. Read your access log and confirm that client addresses look diverse and plausible instead of a handful of repeating proxy ranges. Then compare your security plugin’s IP-detection setting, which most good ones expose, with what the edge actually sends.
The flow in the figure shows where each check lives. Notice that the origin firewall is a separate gate behind the edge, not a copy of it, and that the last step depends on a setting inside WordPress.
A request through edge and origin
- Visitor connectsDNS points your domain at the edge network, not at your server.
- Edge inspectsRate limits, bot checks and firewall rules run on the provider’s machines.
- Edge forwardsAllowed requests go to the origin with the visitor address in a forwarded header.
- Origin firewall checks the senderOnly the provider’s address ranges or a client certificate may connect.
- Web server rules runBlocked paths and static files are handled before PHP starts.
- WordPress reads the real IPPlugins and login limiters must trust the right header, and only from the edge.
The server layer: firewall, web server rules and PHP settings
The server layer is the quietest and cheapest part of the stack, because it refuses things before WordPress wakes up. It has three parts, and each sees something different.
The network firewall decides which ports are reachable from which addresses. On a typical WordPress server the answer is short: ports 80 and 443 open to the world or only to your edge provider, SSH reachable from as few addresses as you can manage, everything else closed. A database port facing the internet, or a Redis or Memcached instance with no authentication on a public interface, is a classic way to lose a site without any WordPress flaw involved. If you can run a firewall at your cloud provider as well as on the machine, do both: root on the box can rewrite its own firewall but not one that lives outside it. For SSH, use keys, disable password login and restrict by address or VPN; moving the port only reduces log noise. Tools such as fail2ban watch logs and ban repeat offenders at the firewall, which suits SSH well. Behind an edge proxy, though, the log shows the proxy’s address, and a careless ban can block your own edge provider and take the site down. To see what a machine is listening on, run this, then ask of each line whether it should be reachable from outside.
$ sudo ss -tlnp
Bind internal services such as the database to the loopback address or a private network too, so one wrong firewall rule is not the only barrier. Before you enable a default-deny policy, allow your own SSH access first and keep the provider’s console available as the way back in.
The web server sees each request before PHP does, so it is the cheapest place to say no. Useful rules: no PHP execution inside the uploads directory, because uploads should hold media and not code, so an upload flaw cannot become a shell; no access to hidden files, version-control folders, environment files and forgotten backups or database dumps in the web root; no directory listings; and a block on xmlrpc.php if nothing you use depends on it. Where these rules live matters. Apache reads per-directory .htaccess files, while Nginx ignores .htaccess completely and needs rules in its own configuration. A plugin that writes .htaccess hardening on an Nginx server may report success while doing nothing, so test a rule by requesting a path it should block instead of trusting a green tick. Security headers belong at the server or the edge too: set there, they cover static files, while a plugin can only add headers to responses that PHP produces. Start with HSTS, nosniff and a sensible referrer policy, and introduce Content Security Policy in report-only mode first, because a strict policy breaks the inline scripts that page builders and analytics tags rely on.
$ curl -sIL example.com | grep -i -E "^(HTTP|server|strict-transport-security|x-content-type-options)"
PHP configuration is the third part. In production keep display_errors off, because error output leaks file paths and sometimes query text, and keep log_errors on with the log outside the web root. Consider disable_functions for process-spawning functions such as exec, shell_exec, system, passthru, proc_open and popen. It raises the cost of turning an upload flaw into a command shell, but some backup, image and import plugins call them, so trial it on a staging copy. Set expose_php off so responses stop advertising the version. Stay on a PHP branch that still receives security fixes and check the supported-versions page on php.net, since end-of-life branches get none. One classic trap: the command-line PHP that WP-CLI uses and the PHP-FPM or Apache module that serves the site read different configuration files, so a setting changed for one does not change the other.
File ownership, permissions and site isolation
If you could add only one server-level control, make it this: stop PHP from being able to rewrite its own code. On many simple setups the files are owned by the same operating system user that PHP runs as. That makes dashboard updates work, and it also means any code-execution flaw lets an attacker modify any plugin, theme or core file, tuck a backdoor into a file you will never open, and edit wp-config.php. A scanner then has to find a needle that the attacker was free to hide anywhere.
The alternative is to separate ownership. Files belong to a deploy or SSH user, and PHP runs as a different user that can read the code but write only to the directories that need it, usually uploads and cache folders. A flaw that gives an attacker code execution then lands in a small writable area, which is easier to monitor and, combined with the no-PHP-in-uploads rule, much less useful. The cost is that dashboard installs and updates stop working unless they have another route: WP-CLI run by the owning user, a deployment pipeline, or an updater your host provides. Many managed hosts already work this way, so ask yours.
Permissions are the smaller half. Directories at 755 and files at 644 are the usual baseline, and wp-config.php deserves something tighter, such as 640 or 600, as long as the PHP user can still read it. Nothing in WordPress needs 777, which lets every account on the machine write. Two commands find common problems: world-writable files, and PHP files sitting inside uploads.
$ find . -type f -perm -0002
$ find wp-content/uploads -type f -name "*.php"
A constant in wp-config.php helps from inside WordPress. This one removes the theme and plugin code editor from the dashboard, so an attacker holding an admin session cannot edit PHP there. A stronger sibling, DISALLOW_FILE_MODS, blocks all dashboard installs and updates, automatic ones included, so use it only when updates arrive by another route.
define( 'DISALLOW_FILE_EDIT', true );
Isolation is the same idea between sites. If five sites share one PHP user, a flaw in the smallest one can read the others’ wp-config.php, steal their database credentials and rewrite their files. That is how whole servers get reinfected after you clean one site and leave its neighbours alone. Separate operating system users, separate PHP-FPM pools or containers per site, and a separate database user per site with rights only on its own database all shrink that blast radius. On shared hosting you cannot choose, so ask how accounts are isolated and treat the answer as a security feature.
Who can write to the code?
| PHP owns the files | Owner separate, PHP read-only | |
|---|---|---|
| Code-execution flaw | Attacker can rewrite plugins, themes and core | Attacker is limited to writable folders such as uploads |
| Backdoor hiding places | Any PHP file on the site | Only the few writable paths |
| Dashboard updates | Work as they are | Need WP-CLI, a pipeline or a host updater |
| Setup effort | None, common on simple setups | Needs host support or server skill |
| Best fit | Small sites that accept the risk | Stores, memberships and agencies |
The endpoint firewall inside WordPress
A plugin firewall is PHP code that inspects requests reaching PHP and decides whether they may continue. Its great strength is context. Once WordPress is loaded, it knows the user, the role and the route being called, so it can do things an edge firewall cannot: block one parameter on one plugin’s endpoint, throttle failed logins per username instead of only per IP, require two-factor authentication for administrators, or notice that a file in a plugin directory changed. Rules aimed at a specific plugin flaw are precise, which usually means fewer false positives than generic attack signatures.
The limits come from where it runs. It sees only requests that reach PHP, so static files and anything answered by an edge or page cache never touch it. It runs as the same user as the site, so an attacker with write access can often delete its directory, edit its settings or simply work around it. And depending on how it loads, it can miss a request entirely. Some plugin firewalls offer two modes. In the basic mode the firewall loads as part of WordPress, so a PHP file that never boots WordPress can be reached without passing it. In the extended mode it attaches through PHP’s auto-prepend setting and runs at the start of every PHP request handled by that configuration, before the requested file’s own code. That closes the bypass, but it needs a PHP setting your host must allow, and it leaves a dependency outside the plugin directory. If you migrate hosts or delete the plugin while the setting still points at a file that no longer exists, PHP can fail on every request until the setting is removed, so follow the vendor’s uninstall steps.
Cost is the other half. A plugin firewall evaluates rules on every PHP request and often writes logs to the database or disk. Security plugins that also scan files and show live traffic can rank among the heaviest plugins on a small plan. Free and paid tiers of some products differ in how quickly new rules arrive, so check the vendor’s current policy before assuming a free install covers a flaw announced yesterday. Finally, a plugin firewall sees the address your server sees, so the real-IP setting from the previous section applies here with full force.
Two ways a plugin firewall can load
| Loads with WordPress | Prepended before WordPress | |
|---|---|---|
| When it runs | Once WordPress starts loading | At the start of each PHP request in that configuration |
| What it can miss | A PHP file reached directly that never loads WordPress | Far fewer bypasses, since it runs before the file’s own code |
| Setup | Install and activate | Needs a PHP setting the host allows |
| Risk on removal or migration | Low | A leftover setting can break every PHP request |
| Best fit | Hosting without access to PHP settings | Servers where you or the host control PHP configuration |
Vulnerability intelligence and virtual patching
Public vulnerability reports about WordPress concern plugins and themes far more than core, and the typical compromise follows a pattern: a flaw becomes known, a fix is released, and sites that have not updated get probed. That makes a different kind of control valuable, one built on knowledge rather than blocking. A vulnerability database records which versions of which plugins are affected. A service or plugin compares your installed versions against it and tells you that the contact form plugin on your site has a known problem. This is the cheapest high-value alert you can have, because it turns “something somewhere is vulnerable” into a specific action on a specific plugin.
Virtual patching is the blocking side. A vendor analyses a disclosed flaw, writes a rule that recognises the exploit pattern for that plugin and parameter, and deploys it so that matching requests are stopped even though the vulnerable code is still installed. Compared with a generic signature, a virtual patch is narrow, so it can be precise and cause fewer false positives. Where the rule is enforced matters. It can run at an edge service, in a web server module, or in a plugin or host integration inside WordPress. Ask which, because that decides whether it sees authenticated requests, whether it adds PHP work and whether it survives a compromise of the site. The product page in the figure lists hosting partners, a sign that some vendors sell through hosts rather than directly to site owners, so your host may already provide part of this layer.
Virtual patches have clear limits. They cover only the flaws a vendor has analysed and written rules for, usually the serious and well-documented ones. A determined attacker can sometimes craft a variant the rule misses. And they leave the underlying code untouched, which is why they are a bridge to the update and not a replacement for it. Their strongest use is the plugin with no fix coming because the developer abandoned it. There the rule buys time while you plan a replacement, and the real decision is to replace the plugin.
Two habits make this layer pay off. First, route alerts to a named person with a deadline, because an alert nobody reads is the same as no alert. Second, delete plugins and themes you do not use instead of merely deactivating them: the files of an inactive plugin stay on disk, and in some cases a vulnerable file can be requested directly by URL without the plugin being active. Vendors also publish comparisons against other firewalls on their marketing pages. Treat those as claims until you see the method behind them, because the outcome depends heavily on which flaws and which rules were chosen for the comparison.

Patching has a clock on every layer
Every layer has its own patch clock, and the slowest clock sets your real exposure. Operating system packages and system libraries are patched by the host on shared and managed plans and by you on an unmanaged server, where automatic security updates are worth enabling and some kernel fixes need a reboot or a live-patching service. The web server and PHP follow the same split, with the extra question of whether your PHP branch is still supported. WordPress core applies minor and security releases automatically by default, while plugins and themes update automatically only if you switch that on for each one, a setting WordPress has offered since version 5.5. Libraries bundled inside a plugin are patched only when the plugin developer ships a new release, so you depend on their attention. An edge firewall has no patch clock for you at all, because the provider updates its rules centrally, which is part of its appeal.
The figure follows the life of a typical plugin flaw. The span between public details and your update is the exposure window, and attackers read advisories too. Three things shorten your part of it: an alert that reaches a person, a process that can apply the update the same day for severe flaws that need no login, and a staging copy for the sites where a broken update costs money. A WooCommerce store might auto-update low-risk plugins but stage anything touching checkout, memberships or payments, with an agreed maximum delay for security releases. The numbers in a policy like that are yours to set, so treat any example as an illustration. You can list what is waiting with two commands.
$ wp core check-update
$ wp plugin list --update=available
The last step matters as much as the update. If a site ran a vulnerable version while exploit attempts were circulating, updating closes the door but does not tell you whether someone already walked through. Check the administrator list, recent file changes and unexpected scheduled tasks, and use the checksum tools from the next section.
The exposure window of a plugin flaw
Scanners and login hardening: what each can prove
Scanners come in three kinds, and each proves something different. File integrity checks compare your core files, and plugin files from the official repository, against known-good copies. That is the most reliable detection you can run, because a modified core file shows up however the added code is disguised, but it cannot judge custom code or premium plugins that have no published checksums. Signature and heuristic scanners look for known malware patterns and suspicious code shapes. They catch commodity infections, miss new code and raise false alarms on legitimate obfuscated or minified code, which is common in licensing and optimisation plugins. Remote scanners fetch your public pages and check for injected spam or blocklist listings. They see only what the site shows the public, so a backdoor that serves clean pages to everyone but the attacker is invisible to them.
Where a scanner runs is part of how far you can trust it. A scanner inside WordPress runs in a possibly compromised environment where an attacker can tamper with it or its results, and it reads every file, so schedule it off-peak and throttle it on small plans. A scanner at the server level, whether provided by the host or built on a tool such as ClamAV, runs outside PHP and sees the whole account, including files outside WordPress. The most independent check is a read-only comparison run from the shell, which also works when the dashboard does not.
$ wp core verify-checksums
$ wp plugin verify-checksums --all
Login hardening is the clearest case where layers split the job by what they know. At the edge or server, rate limiting POST requests to wp-login.php and xmlrpc.php is cheap and happens before PHP. But a botnet can spread guesses across thousands of addresses so that no single address trips the limit, while an office behind one shared address can trip it by accident. Inside WordPress, per-username lockouts, two-factor authentication and passkeys use account knowledge the edge lacks. XML-RPC deserves special care. Its multicall method lets one request carry many password guesses, so request-count limits undercount, and if nothing relies on XML-RPC you should block it at the server. Check before assuming, since some connectors and mobile apps use it. Changing the login URL cuts bot noise but is not authentication.
The honest summary is that credential stuffing with a correct, leaked password looks like a normal login, so no firewall rule stops it. Two-factor authentication, unique passwords from a password manager and a short list of administrators do. Audit that list now and then.
$ wp user list --role=administrator --fields=ID,user_login,user_email,user_registeredCost, false positives and duplicate controls
Every control spends something, and the bill depends on where it runs. A network firewall costs almost nothing per request. An edge firewall moves its work to the provider and adds a network hop that caching often offsets, so check how it behaves on your uncached pages. Web server rules are cheap, though a full OWASP Core Rule Set under ModSecurity or a compatible engine is real CPU work at higher sensitivity levels. A plugin firewall spends PHP time and database or disk writes on each request that reaches it, and scanners spend input and output across your whole file tree.
Caching changes who pays. Responses served by an edge or page cache never reach PHP, so the plugin neither slows them nor sees them, and its logs and rate limits cover only cache misses and dynamic requests. A cache-heavy brochure site barely notices the plugin. A WooCommerce store’s cart, checkout and account pages are uncached by design, so every request there carries the plugin’s full cost and its full filtering.
False positives follow the same logic: the more generic the rule, the more innocent traffic it catches. Typical victims are an editor pasting code or HTML into a post, a page builder saving a large payload, a tutorial site publishing SQL examples, payment webhooks that arrive without browser-like headers, uptime monitors, and WordPress’s own loopback requests for cron and health checks. Higher sensitivity levels in a rule set catch more attacks and more legitimate traffic. The method that works is staged. Run new rules in a detect-only or log-only mode first (ModSecurity has a detection-only engine mode, and many firewalls and plugins offer a learning or simulate mode), review what would have been blocked, exclude narrowly by rule and path instead of switching the firewall off, then enforce. Review blocked-request logs after major plugin changes, and treat a blocked request to an admin or checkout path as a support ticket in waiting.
Duplication is the other drain. Login throttling can exist at the edge, in fail2ban and in a plugin. Keep the cheap volume limit outside PHP and the per-user lockout and two-factor login inside, and avoid three layers banning at different thresholds, which makes “why am I blocked” unanswerable. Run one endpoint firewall plugin, never two, and avoid two scanners reading every file at the same time. Set each security header in one place, because duplicated or conflicting headers behave unpredictably. A mismatch between the edge’s encryption mode and the origin’s HTTPS redirect is a classic source of endless redirect loops, so use full encryption between edge and origin with a certificate the edge can validate. And keep a map of where each block comes from, since the edge, the web server and a plugin each serve their own error page and headers.
Context against cost
How to read this: each row is one option, and its dot shows where it sits between Sees little, costs little and Sees a lot, costs PHP time. Placement is an editorial judgement, not a measurement.
- 1Network firewallPorts and addresses only, negligible work per request.
- 2Edge firewallRequest text and traffic patterns, with the provider doing the work.
- 3Web server rulesCheap rules, though heavy rule sets cost CPU.
- 4Plugin firewall, prependedRuns on every PHP request before the file’s own code.
- 5Plugin firewall, loads with WordPressSees users, roles and routes, and adds PHP and database work.
- 6Scanning and traffic logging in WordPressReads many files or writes logs, so schedule and throttle it.
What your host actually does: a responsibility matrix
“Secure hosting” means different things on different plans, so start with who runs what. On shared hosting many accounts sit on one operating system. The host owns the network, the operating system and the PHP builds, and the quality of isolation between accounts varies by provider. On managed WordPress hosting the provider typically owns more of the stack, often including a firewall, malware scanning, platform patching and backups, and in return restricts what you can install or change, sometimes blocking specific plugins. On an unmanaged VPS or cloud server you own everything from the firewall down, unless a server-management panel or service automates parts of it. Several such panels exist and what each configures by default, whether firewall rules, fail2ban, automatic updates or backups, differs, so check the list instead of assuming.
Whatever the plan, some things stay yours: the strength of your admin passwords, which plugins you install and whether you update them, who has accounts, and what you publish. A host cannot protect a site from an administrator who reuses a leaked password, and a host-level firewall will not know that a particular admin-ajax call from a subscriber is abuse.
Questions worth asking before you rely on a host’s security claims:
- Where does the firewall run, at the network edge or per account, and how are its rules updated?
- Does malware scanning remove files or only report them, and how often does it run?
- How are accounts isolated, and does each site’s PHP run as a separate user?
- Who patches the operating system and PHP, how fast, and how long do older PHP branches stay available?
- Are backups stored away from the server, how long are they kept, and has a restore been tested?
- Can you read raw access and error logs, and for how long?
- Is two-factor login available on the hosting account, and is cleanup after an incident part of support?
Also protect the accounts above the site. The hosting panel, the edge provider and the domain registrar can each undo every control in this comparison, so two-factor login there is not optional. The matrix summarises the usual split, and wherever a cell says the host owns something, verify it in the plan’s documentation.
Who owns what
| You | Your host | Plugin or service | |
|---|---|---|---|
| Open ports and network rules | Own it on a VPS | Owns it on shared and managed plans | Cannot do it reliably |
| Operating system and PHP patching | Own it on an unmanaged server | Owns it on shared and managed plans | Can only warn about old PHP |
| File ownership and isolation | Verify the setup | Provides the mechanism | Can check and warn |
| Firewall rules for known attacks | Switch on, tune and review blocks | May run network or account rules | Endpoint rules or an edge service |
| Core, plugin and theme updates | Own the decision and the testing | May run core updates | Alerts and virtual patches buy time |
| Admin accounts and two-factor login | Own it entirely | Secures the hosting panel | Secures WordPress logins |
| Backups and restore tests | Test a restore | Often provides snapshots | Can copy offsite on a schedule |
A layered baseline by site type
Layers should follow exposure, not fear. The baselines below build from the outside in, and each one includes the one before it. They are starting points, not guarantees, and any numbers or sizes in the examples are illustrations.
- Small brochure or blog site. A host or edge firewall in front, automatic updates for core and low-risk plugins, two-factor login for every administrator, one security plugin used for login rules and file integrity checks (not a second firewall if your host or edge already filters), no PHP execution in uploads, and offsite backups with a tested restore.
- WooCommerce store. Add edge rate limiting on login, cart and checkout, and bot challenges on the checkout path, since card-testing bots probe checkout forms. Allow-list your payment provider’s webhook sources so the firewall does not drop real orders, stage updates for anything touching checkout, give shop staff the least role that works, and use hosted payment fields where your provider offers them. Payment-card rules and local regulations have their own requirements, so treat this as orientation and check the actual rules.
- Membership, course or community site. Most traffic is logged in and uncached, so application context matters more. Add an endpoint firewall and vulnerability alerts, regular role audits, upload type limits and registration throttling, and plan for false-positive tuning because members paste content.
- Agency with many client sites. A separate operating system user, PHP pool and database user per site, one standard baseline applied everywhere, central update and alert handling, and an offboarding checklist for departing staff.
- High-traffic publisher. Cache at the edge so most requests never reach the origin, lock the origin to the edge, deploy code from version control with PHP unable to write it, and require strict two-factor login or single sign-on for editors.
For a control that is on none of these lists, use the decision rule in the figure: ask what the control needs to know, and put it in the layer that can see it. Then ask the independence question, whether it survives a compromise of the thing beneath it, and add a second layer wherever the answer matters more than the cost.
Which layer should own this control?
Read this next
About this comparison. This is general guidance written by WPresident Editorial from documentation and widely used practice. WPresident has not benchmarked the products or methods described. Interfaces and plan limits change, so check the vendor’s current documentation before you act. Not legal, tax or financial advice. See our editorial policy.
Frequently asked questions
Do I need a security plugin if my host already runs a firewall?
Often yes, but a smaller one. A host firewall filters traffic before WordPress, yet it cannot see logins, roles or file changes inside the site. A plugin adds two-factor login, per-user lockouts, file integrity checks and alerts. If your host already filters attacks, avoid a second full firewall and use the plugin for the parts only WordPress can see. Confirm in your host's documentation where its firewall runs and what rules it applies.
Is an edge firewall such as Cloudflare enough on its own?
No. It sees requests, not WordPress sessions, so it misses flaws that look like ordinary logged-in activity. It also cannot see files on your server, and it protects nothing if your origin address is reachable directly. Pair it with origin lockdown, updates, two-factor login, sensible file ownership and a checksum or scanner routine. Verify which rule sets your plan includes and confirm that they are switched on.
Can a security plugin protect me if my server is already compromised?
Not reliably. A plugin runs as the same user as the site, so an attacker with write access can often remove it, alter it or work around it, and scanners inside WordPress can be tampered with. After a compromise, lean on checks from outside, such as WP-CLI checksums from the shell, a host-level scan and a restore from a known-clean backup, and close the entry point before bringing the site back online.
Should I run two firewall plugins, or a plugin and an edge firewall?
Run one endpoint firewall plugin, never two, because they compete for the same hooks and slow every request. A plugin plus an edge firewall is a sound pairing, since they sit in different places and see different things. Keep them from clashing by setting the real-IP header correctly, setting security headers in one place and avoiding the same traffic being banned at three different thresholds.
Why did my firewall block my own admin or checkout?
Generic rules fire on content that resembles attacks, such as pasted code, large page-builder payloads or webhook calls without browser headers. Rate limits also trip when many users share an address or when a proxy hides real IPs. Read the blocked-request logs in each layer, add narrow exclusions by rule and path, and trial new rules in detect-only mode. Keep SFTP, SSH or WP-CLI access so you can deactivate a plugin if you lock yourself out.
What file permissions should a WordPress site use?
A common baseline is 755 for directories and 644 for files, with wp-config.php tighter, such as 640 or 600, as long as PHP can still read it. Never use 777. Ownership matters as much as the numbers: ideally PHP cannot write plugin, theme and core files, only uploads and cache. Your host may require specific values, so check its documentation before changing a managed environment.
Does a server-level firewall like ModSecurity slow WordPress down?
It adds CPU work for each request it inspects, and the amount depends on the rule set and sensitivity level, so there is no single honest figure. Lower sensitivity levels cost little, while higher ones cost more and raise false positives. Start in detect-only mode, watch what would be blocked, and measure your own site before and after instead of trusting generic claims. Many hosts run it for you, so ask first.
What is virtual patching, and can it replace updates?
Virtual patching blocks the exploit pattern of a specific known flaw with a rule, so the vulnerable code can stay installed for a while without being reachable by that exploit. It cannot replace updates, because variants can slip past and the flaw itself remains. Use it as a bridge while you test the update. For an abandoned plugin, use it only while you move to a replacement.
How do I stop attackers reaching my origin server directly?
Restrict the origin to your edge provider. Allow ports 80 and 443 only from the provider's published address ranges, or require authenticated origin pulls or mutual TLS where it offers them. Remove old DNS records and unproxied subdomains that reveal the origin address, and test by requesting the site by IP address from outside the allow list. Keep the range list current, since providers change it.
Which layer should handle brute-force login attacks?
Split the work. The edge or web server should rate limit requests to wp-login.php and xmlrpc.php cheaply, before PHP starts. WordPress should handle per-username lockouts and two-factor login, which need account knowledge. Strong unique passwords and two-factor login matter most, because attacks using leaked passwords look like normal logins. Block XML-RPC at the server if nothing you use depends on it.



