Skip to content

Wordfence vs Sucuri: which WordPress security setup fits your site

Use this Wordfence vs Sucuri guide to see where each tool actually blocks attacks and pick the one that fits your WordPress site. You will check that your chosen firewall is really active, confirm that traffic goes through it, and close the gaps that let attackers go around it.

This guide compares Wordfence and Sucuri for WordPress site owners, agencies and the admins of the cPanel servers those sites run on. Both names show up in every security discussion, and it is hard to tell whether you need one, the other, or both. The short answer is that they block attacks in different places. Wordfence is a firewall and scanner that runs inside WordPress on your own server, while Sucuri’s main value is a cloud firewall that filters traffic before it ever reaches your server. By the end you will know which model fits your site, and you will have checked that the one you use is really working.

What you’ll accomplish

  • A clear picture of where each tool stops a bad request, and what that costs your server.
  • Proof that Wordfence runs in Extended Protection mode, so its firewall loads before WordPress does.
  • Proof that visitors really reach your site through Sucuri’s firewall, if you use it.
  • An origin server that refuses direct traffic, so nobody can go around the cloud firewall.
  • A short list of the server-level protections your cPanel host may already provide.

Prerequisites

You need SSH access (the secure remote terminal) to the hosting account, or at least the cPanel File Manager. WP-CLI, the official WordPress command line tool, makes step 1 faster. Run wp --info after you log in; if it prints a version, you are ready.

You also need dig and curl, which come with macOS and most Linux systems. For the Sucuri steps you need access to your Sucuri firewall dashboard. For the Wordfence steps you need an administrator login on the WordPress site.

The commands assume Apache 2.4 or LiteSpeed with PHP-FPM or LSAPI, which covers most cPanel servers today. Replace example.com with your domain and 203.0.113.10 with your server’s real IP address in every command.

How it works

The difference between the two tools is where they sit on the path a request takes. The diagram shows the same attack reaching a site protected each way.

Two request paths compared. With Sucuri, the visitor reaches the Sucuri edge first, which blocks bad requests before they reach your server and WordPress. With Wordfence, every request reaches your server and starts PHP, and the Wordfence firewall blocks it just before WordPress loads.

Wordfence is an endpoint firewall. Endpoint means it runs on the machine it protects. PHP loads a small file called wordfence-waf.php before any WordPress code, using a PHP setting named auto_prepend_file. That file checks each request against firewall rules, and blocked requests never reach WordPress. Wordfence also scans your files for malware, adds two-factor login (a second code from your phone), and limits password guessing. Because it runs inside WordPress, it sees the logged-in user and the exact plugin being targeted.

The cost is that every request, good or bad, still arrives at your server. Each one starts a PHP worker (one of the limited processes that run PHP code) for a moment. Malware scans also run on your server’s CPU. A large bot flood can use up your PHP workers even while Wordfence blocks every request.

Sucuri’s main value is a cloud WAF. A WAF, or web application firewall, filters web requests for attack patterns. You point your domain’s DNS at Sucuri, visitors connect to Sucuri’s network, and only clean requests are forwarded to your server. Sucuri also caches pages, which acts like a CDN (a content delivery network that serves copies of your pages from servers near the visitor). Blocked traffic, including most floods, never touches your server.

The free Sucuri Security plugin is a different product. It audits activity, hardens settings and runs a remote scan, but it does not block traffic. Our guide to when the Sucuri plugin adds value covers it in detail. Sucuri’s paid plans add the cloud firewall, monitoring and a malware cleanup service.

A cloud WAF has one weak point. If attackers learn your server’s real IP address, they can send requests straight to it and skip Sucuri completely. Locking the origin (your real server) so it accepts web traffic only from Sucuri closes that gap.

WordfenceSucuri (firewall plan)
Where it filtersOn your server, inside PHPOn Sucuri’s network, before your server
Bad traffic reaches your serverYes, then is blockedNo, when the origin is locked
Protection from floodsLimited by your server capacityAbsorbed by Sucuri’s network
Malware scanningLocal file scan on your CPURemote scan, plus a server-side scanner option
Knows WordPress users and pluginsYesOnly what it sees in the request
Free tierPlugin with firewall rules and signatures that arrive later than paid onesPlugin only, no firewall

On a cPanel server there is often a third layer already. ModSecurity (a WAF module for Apache and LiteSpeed), Imunify360 and the CSF firewall work at the server level for every site on the machine. Our comparison of Fail2Ban, CSF and Imunify explains what each one covers.

Step-by-step

1. Find out what the site runs today. Many sites have both plugins installed from past advice, and some have neither active.

wp plugin list --status=active --fields=name,version | grep -Ei 'wordfence|sucuri'

Each active plugin prints one line, with wordfence or sucuri-scanner followed by its version. No output means neither plugin is active. Having the Sucuri plugin active does not mean the Sucuri firewall is in front of the site. Step 3 checks that.

2. Confirm Wordfence runs in Extended Protection. In Basic mode, the Wordfence firewall loads as a normal plugin, after WordPress has already started. Extended Protection loads it first through auto_prepend_file. In WordPress, open Wordfence, then Firewall, and read the Protection Level. It should say Extended Protection. Then check the file on disk.

cd ~/public_html
grep -A1 -i "wordfence waf" .user.ini .htaccess 2>/dev/null
ls -l wordfence-waf.php

On PHP-FPM or CGI servers you should see the setting in .user.ini:

.user.ini:; Wordfence WAF
.user.ini-auto_prepend_file = '/home/example/public_html/wordfence-waf.php'

On LiteSpeed or mod_php the same setting appears in .htaccess as a php_value auto_prepend_file line. The ls command should list wordfence-waf.php. If neither file contains the setting, click Optimize the Wordfence Firewall on the Firewall page and follow the prompts. The Wordfence help center describes each server type.

3. Check whether traffic really goes through Sucuri. Your DNS should point at a Sucuri firewall IP, and the responses should carry Sucuri headers.

dig +short example.com A
curl -sI https://example.com/ | grep -iE '^(server|x-sucuri)'

The dig result should match the firewall IP shown in your Sucuri dashboard, not your server’s IP. The curl output should look like this, although the ID number varies:

server: Sucuri/Cloudproxy
x-sucuri-id: 18016

Other headers starting with x-sucuri- may appear as well. If the server line shows cloudflare, Apache or LiteSpeed, traffic is not passing through Sucuri. Update the DNS record to the IP from the Sucuri dashboard before you continue.

4. Test whether your origin answers directly. This tells you whether someone can go around Sucuri. The --resolve flag makes curl connect to the IP you give, instead of the one DNS returns.

curl -sI --resolve example.com:443:203.0.113.10 https://example.com/ | head -n 1

If you see HTTP/2 200 or HTTP/1.1 200 OK, anyone who knows your server IP can skip the firewall. Old DNS records, mail headers and past scans often reveal that IP, so assume it is known.

5. Lock the origin to Sucuri. Sucuri publishes the list of IP ranges its firewall connects from in its documentation. Add them to the top of ~/public_html/.htaccess. The ranges below are placeholders from the documentation address space. Replace them with Sucuri’s current list and your own server IP.

# BEGIN Sucuri origin lock
<RequireAny>
    Require local
    Require ip 203.0.113.10
    Require ip 192.0.2.0/24
    Require ip 198.51.100.0/24
</RequireAny>
# END Sucuri origin lock

Require local and your server IP keep WordPress’s own loopback requests working, such as WP-Cron (WordPress’s built-in task scheduler). If you run a dedicated server with one site, you can apply the same allowlist in the server firewall instead. Blocking at the firewall saves Apache the work.

6. Tell Wordfence about the proxy, if you run both. Behind Sucuri, every request arrives from a Sucuri IP. Wordfence must read the real visitor IP from a header, or it will rate-limit and block Sucuri itself. In Wordfence, open All Options, find How does Wordfence get IPs, and choose the X-Forwarded-For HTTP header. Add Sucuri’s IP ranges to the trusted proxies field below it. The page shows your detected IP; it should match your own public IP, not a Sucuri address.

7. List what the server already does. On cPanel, run these as root to see the server-level layers.

httpd -M 2>/dev/null | grep -i security
csf -v
imunify360-agent version

security2_module (shared) means ModSecurity is loaded. A version line from csf or imunify360-agent means that tool is installed. “Command not found” means it is not. If ModSecurity and Imunify360 are already active, you may not need a heavy Wordfence scan schedule on top.

Validate it works

Run the origin test from step 4 again.

curl -sI --resolve example.com:443:203.0.113.10 https://example.com/ | head -n 1

It should now print HTTP/2 403 or HTTP/1.1 403 Forbidden. Then load the site normally in a browser and repeat the header check from step 3. You should still get a normal page and the Sucuri headers.

Next, send a harmless test string that looks like an attack.

curl -s -o /dev/null -w '%{http_code}\n' -G --data-urlencode 's=<script>alert(1)</script>' https://example.com/

A working firewall usually answers 403. Sucuri shows its own block page, and Wordfence logs the event under Firewall. If you get 200, check the firewall logs to see whether the request was only logged and not blocked.

Finally, open Wordfence Live Traffic and browse the site from your phone. The entries should show your phone’s real IP. If every entry shows the same few addresses, step 6 is not done yet.

Troubleshooting

Every visitor gets 403 after the origin lock. Your server probably rewrites the client IP from a proxy header. cPanel’s mod_remoteip or LiteSpeed’s client IP setting can do this. Require ip then checks the visitor’s IP, not Sucuri’s, and blocks everyone. Remove the block, then either apply the allowlist in the server firewall or turn off that IP rewriting for this site.

Wordfence blocks or rate-limits a Sucuri IP. The whole site then goes down for every visitor using that Sucuri node. Unblock the IP under Firewall, Blocking, then finish step 6 so Wordfence sees real visitor IPs.

Wordfence still says Basic protection after you optimized it. PHP caches .user.ini for 300 seconds by default, a value set by user_ini.cache_ttl. Wait five minutes and reload the Firewall page. If it still says Basic, check that the path in the file matches pwd in your site folder.

The site slows down during Wordfence scans. Scans read every file with your own CPU and PHP. Turn on the low resource scanning option in Wordfence’s scan settings, and schedule scans outside business hours. On a server with Imunify360 you can also scan less often from Wordfence.

The headers show Cloudflare instead of Sucuri. Your DNS is proxied through Cloudflare, so Sucuri is either skipped or stacked behind it. Two proxies in a row make debugging, caching and IP detection harder. Pick one edge. If you keep Sucuri, set the Cloudflare record to DNS only. If you keep Cloudflare, rely on its WAF and lock the origin to Cloudflare’s ranges instead.

When this is the wrong approach

If your site is already hacked, pause this comparison and follow the first 60 minutes of WordPress incident response. Choosing a firewall comes after the cleanup.

If you already use Cloudflare’s WAF, adding Sucuri gives you a second proxy with the same job. Wordfence on top of Cloudflare is a more common and simpler pair.

A small brochure site on a well-run cPanel server with ModSecurity and Imunify360 may need neither. Two-factor login and fast updates cover most of the remaining risk. If you do keep Wordfence, our Wordfence baseline guide shows which alerts are worth your attention.

Plenty of sites use both tools together, with Sucuri at the edge and Wordfence for login security and file scans. That pairing works well once step 6 is done.

Running WordPress that earns real money deserves an operator — Stack Harbor runs that stack under Enterprise WordPress; book an infrastructure consult.