WordPress security runs in three places: at the edge, before traffic reaches your server; on the server itself, below WordPress; and inside WordPress, where security plugins live. Where a firewall runs decides what it can see, and what it can see decides what it can stop. Most of the arguments about Wordfence versus Cloudflare versus "my host handles it" come from treating the three as interchangeable. They aren't.

The short answer: put the heavy lifting at the edge and on the server, and keep the application layer for the few jobs only WordPress can do, such as two-factor login. Then make sure the layers are set up to work together, because a plugin that sees the wrong visitor address, or a server anyone can reach around your edge firewall, quietly undoes the protection you think you have. And none of the three replaces updating your plugins.

I'm Shane Larrabee. I've run FatLab, a managed WordPress host, since 2011, and I've been building websites since 1999. We run the edge and server layers across 200+ WordPress sites, plus a small layer of our own inside WordPress, and we take over plenty of sites that arrive with a security plugin already installed. Most of what's below comes from watching the layers interact: where they overlap, where they clash, and what slips between them.

The Three Layers, in the Order a Request Meets Them

Every request to your site passes the layers in the same order: the edge network first, then your server, then WordPress and its plugins. Each one gets a different view of that request. (For the full path a flood takes, see how DDoS attacks hit WordPress.)

The edge: Cloudflare, Sucuri's firewall service

An edge firewall sits in a network of data centers between your visitors and your server. Your domain points at the edge, the edge inspects each request, and only what it lets through goes on to your server.

What it sees: every request before your server does, including the address it came from, the URL, the headers and the request body. It also sees traffic across millions of other sites, which is why a new attack pattern spotted somewhere else can be blocked on yours.

What it can't see: anything inside your site. It doesn't know whether a request belongs to a logged-in administrator, which WordPress user a login attempt is aimed at, what's in your database, or which files are on your disk.

On the sites we host, Cloudflare's managed rules, the ones that match known exploit attempts, flagged more than 270,000 requests in one three-day window this November. That's the edge doing its job: those requests never cost our servers anything.

The server: Imunify360, ModSecurity, Fail2Ban

Server-level security runs on the machine that hosts your site, below WordPress. It works on the operating system, the web server and the files on disk, for every site on that server at once.

What it sees: files as they're written, so a malicious upload can be caught whatever plugin or flaw put it there. Imunify360's documentation describes real-time malware scanning on file upload, through ModSecurity and over FTP. It also sees connection patterns across every site on the server, so an address caught attacking one site can be blocked for all of them.

What it can't see: WordPress's own logic. A server firewall doesn't know a request comes from a logged-in editor, or that five failed logins were all for the same username.

Ours are busy. On a typical day, the server firewalls across our fleet hold about 800 addresses on their block lists, and roughly nine in ten got there automatically, by hitting a challenge page more than a hundred times without ever passing it.

The application: Wordfence and other security plugins

A security plugin runs inside WordPress, in PHP, on your server.

What it sees: everything WordPress knows. It's the only layer that can tell an administrator's session from a visitor's, enforce two-factor login, or block a specific username. That's real value, and no edge or server tool replaces it. It's also busy: Wordfence reports its plugin firewall blocked 9.1 billion attacks and 16 billion password attempts across its sites in the first quarter of 2026 alone (Wordfence Q1 2026 report).

What it can't see: anything before PHP starts. Wordfence is unusually clear about this. In its default "Basic WordPress Protection" mode, the firewall "will load as a regular plugin after WordPress loads," and attackers who request some plugin, core or theme files directly won't trigger it at all, according to its firewall optimization guide. Its optional "Extended Protection" mode closes that gap by changing PHP's configuration so the firewall loads before anything else. Either way, the request has crossed the internet, reached your server and started PHP before the plugin gets a look. For more on what that means in practice, read what a WordPress security plugin can't protect you from.

What Each Layer Can and Can't See

Edge (Cloudflare) Server (Imunify360) Plugin (Wordfence)
Stops a request before it reaches your server Yes No No
Sees pages served from the edge cache Yes No No
Sees requests that skip the edge and hit the server directly No Yes Yes
Sees files written to disk, whatever wrote them No Yes Only on a scan
Covers every site on the server at once Per site Yes No, one site
Knows which WordPress user is logged in No No Yes
Can require two-factor login No No Yes
Keeps working if WordPress itself is broken Yes Yes No
Uses your hosting plan's resources No Some, shared Yes, per request

The table makes the point better than any argument: each layer has blind spots the others cover. That's the case for running more than one. It's also why the way they're connected matters as much as which ones you have.

Where the Layers Get in Each Other's Way

This is the part most comparisons skip. Running all three layers doesn't add up to three times the protection if they're set up to work against each other.

Your plugin may be seeing Cloudflare's address instead of the visitor's

When a site sits behind Cloudflare, every request reaches your server from a Cloudflare address. The visitor's real address travels in a separate header. Cloudflare's own documentation says that by default, an application that depends on the visitor's address will log a Cloudflare IP address instead, unless the web server is set up to restore it.

That matters for a security plugin. If it rate-limits or blocks by address and sees only Cloudflare's, it either can't tell attackers apart, or it blocks a Cloudflare address that thousands of real visitors share. Server tools face the same problem: Imunify360 documents that it reads the visitor's address from Cloudflare's headers when that support is switched on.

On our servers, the web server restores the real visitor address from Cloudflare's header before WordPress ever runs, and it only accepts that header on requests that actually came from Cloudflare. Every layer below the edge sees the same, correct visitor. If you run a security plugin behind Cloudflare on your own hosting, check this first. Look at the addresses in your plugin's live traffic or login log: if they all belong to Cloudflare, your plugin is guessing.

Cached pages never reach the server or the plugin

An edge network answers many requests from its cache, without touching your server. Good for speed and for surviving floods. But it means your plugin's traffic log shows only part of what's happening, and any rule that runs on your server never sees those requests at all.

It also creates odd conflicts. Imunify360's documentation warns that its anti-bot challenge doesn't work with aggressive CDN caching: if the edge caches the challenge page, visitors keep getting the challenge whether they passed it or not. Two good tools, each doing its job, producing a broken site. Somebody has to own how the layers are configured together, not just whether each one is switched on.

Traffic that goes around the edge

An edge firewall only protects traffic that goes through it. If your server answers requests sent straight to its address, an attacker who finds that address skips every edge rule. Cloudflare's own guidance is to protect the origin by refusing traffic that doesn't come from Cloudflare, by authenticating its connections, or by using a tunnel with no public address at all.

On most hosting platforms the server still answers direct requests unless someone does that work. That's exactly why the server layer can't be an afterthought: it's the layer that still sees the traffic that went around the edge. For one news site we host that was under a sustained botnet attack this month, we added a filter at the server that turns away requests without Cloudflare's markers on them. It stopped the automated traffic that was the actual problem. The full story of that attack is in our DDoS guide.

A security scan that only ever met the edge

Layers confuse outside scanners too. Earlier this year, a professional association we host failed a payment-card (PCI) security scan. The report flagged a critical SQL injection flaw in a WordPress maps plugin and asked for an upgrade.

The site didn't have that plugin. It wasn't installed, there were no files for it on disk, and the address the scanner probed returned WordPress's own "no route found" when we tested it from the server. The "proof" in the scan report was Cloudflare's challenge page: the scanner's request had been stopped at the edge and never reached the site. The scanner saw a response it couldn't read and reported the worst case. We documented all of that, and it was a false positive.

The lesson cuts both ways. An edge firewall can make an outside scan look worse than reality, and it can make it look better too. A scanner that never gets past the edge isn't testing your site. Ask what layer a scan actually reached before you act on it.

A plugin firewall that outlives the plugin

Wordfence's Extended Protection works by setting a PHP option called auto_prepend_file, usually through a .user.ini file, so the firewall runs before any other code. Wordfence's guide notes that this setting has to be removed when you reinstall the plugin, remove its data, or sometimes when you move to a new host.

We find it often on sites moving to us from shared hosting: a wordfence-waf.php file and a .user.ini pointing at it in the site's root, left from a plugin setup nobody remembers. Moved as-is to a server where that path doesn't exist, the setting can break PHP outright. We leave both out of the move.

There's a darker side to the same mechanism. A setting that runs a file before every page is exactly what an attacker wants. On one site we host, the hidden code behind a spam injection used that same trick to run on every request. If you find a .user.ini you didn't put there, read it. Our guide to the WordPress redirect hack covers where that kind of code hides.

Two scanners judging the same files

A server malware scanner looks at files. It doesn't know which plugin a file belongs to or whether that plugin is legitimate. Some commercial plugins ship scrambled ("obfuscated") code to protect their licensing, and to a file scanner that looks a lot like malware. Run a plugin scanner on top and you have two tools that can each flag, quarantine or "clean" the same file, and the site owner gets two sets of alerts that don't agree.

Automatic cleanup is useful, and we rely on it. It also needs a person checking what it changed, which is part of a proper security audit.

How Much Each Layer Actually Stops

The honest answer is that generic firewalls, at the edge or on the server, miss most attacks aimed at specific plugin flaws. Patchstack tested five hosting setups in 2025 against 11 known WordPress plugin exploits, using public proof-of-concept code with no tricks:

  • The host behind Cloudflare's firewall blocked 4 of 11.
  • The host running ModSecurity and Imunify360 blocked 1 of 11.
  • Across all five hosts, 7 of 55 attempts were blocked, about 12%.

Two caveats. Patchstack sells the application-layer protection that blocked everything the hosts missed, so read it as vendor research. And we run both of the tools in that test. I'm citing it anyway, because it matches what we see: the edge and the server are excellent against floods, bots, known bad addresses and malware on disk, and weak against a request that looks normal but exploits a flaw in one plugin's code.

That gap is closed by updating the plugin, not by adding another firewall. A layer can buy you time between a flaw going public and the fix landing on your site, and sometimes there's no fix to land yet: Patchstack found that 46% of the WordPress vulnerabilities in its 2025 data had no patch available when they were disclosed (Patchstack, State of WordPress Security in 2026). It still can't replace the fix. I go through how firewall rules cover the gap before a WordPress security update in more detail. That's why weekly, tested updates are the center of how we work, and why compromised WordPress plugins are the threat I'd worry about first.

Which Layer Should Do What

Job Best layer Why
Floods, bots, scrapers Edge Stopped before they cost your server anything
Known exploit patterns Edge, then server Shared threat data across millions of sites
Malware written to disk Server Sees files whatever wrote them, on every site
Bad addresses across many sites Server One block protects every site on the machine
Two-factor login, per-user rules Application Only WordPress knows who's logged in
Hiding usernames Application It's WordPress behavior. See user enumeration
Fixing a vulnerable plugin Your update process No firewall replaces the patch

At FatLab, that's how it's split. Every production site we host sits behind Cloudflare's enterprise firewall. Every server runs Imunify360 and Fail2Ban. Inside WordPress, our own small must-use plugin handles the few things that belong there, and two-factor login is set up for clients who want it. That's why we don't carry security plugins over when we migrate a site: their firewall duplicates the edge and the server, and their extra pieces are the ones that clash. The full list of what we run is on our managed WordPress security page.

What to Ask Your Host

If you're deciding whether you still need a security plugin, the answer depends on what's underneath it. Ask your host:

  1. Is there a firewall at the edge, and is it on for my site? Not available as an add-on: switched on, for your domain.
  2. What runs on the server below WordPress? A malware scanner, a server firewall, login protection across sites.
  3. Can my server be reached without going through the edge? If yes, what protects that path?
  4. Does my site see real visitor addresses? If the answer is a blank look, your plugin's logs may be fiction.
  5. Who updates the plugins, how often, and is anything tested first?

If the answers are vague, you need the plugin, and probably more than the plugin. If you'd rather hand the whole stack to people who run it every day, that's what our managed WordPress security is. Nonprofits can see our nonprofit hosting plans, and if you're still deciding about a plugin, start with do you need a WordPress security plugin?

Frequently Asked Questions

Is server-level security better than a security plugin?

For most of the work, yes. A server firewall and malware scanner run below WordPress, cover every site on the server, and keep working if WordPress breaks. A plugin runs inside WordPress, uses your site's resources, and only sees requests after PHP starts. But a plugin is the only layer that knows which WordPress user is logged in, so jobs like two-factor login still belong inside WordPress.

Do I need Wordfence if my host already runs Imunify360 and Cloudflare?

Usually not for its firewall or scanner, since those duplicate what's already running below it. What you may still want from the application layer is two-factor login, which a lighter dedicated plugin can do. Check first that Cloudflare is actually switched on for your domain and that your server restores real visitor addresses.

Can Wordfence and Cloudflare be used together?

Yes, and many sites do. The catch is visitor addresses: behind Cloudflare, every request reaches your server from a Cloudflare address unless the web server restores the visitor's real one from Cloudflare's header. If your Wordfence logs show only Cloudflare addresses, fix that on the server before relying on Wordfence's blocking or rate limits.

Can attackers bypass Cloudflare and reach my server directly?

If your server answers requests sent straight to its address, yes, and those requests skip every Cloudflare rule. Cloudflare recommends refusing traffic that doesn't come from its network, authenticating its connections to your server, or using a tunnel. Ask your host which of those is in place, and what still protects the server if none is.

What does Imunify360 do for a WordPress site?

It's server security software. It runs a firewall and web application firewall on the server, keeps reputation-based block lists, scans files for malware as they're written and on a schedule, and, with the right add-on, cleans what it finds. It protects every site on the server, not just WordPress, but it doesn't know about WordPress users or roles.

Does a firewall replace updating my plugins?

No. Independent testing shows edge and server firewalls miss most attacks aimed at a specific plugin flaw, because those requests look normal. A firewall can buy time between a flaw going public and the fix reaching your site. Only the update closes it.