The best open source WAF depends on who is installing it. For a platform team with a config pipeline it is ModSecurity with the OWASP Core Rule Set, or Coraza as its modern replacement. For a WordPress site it is BotBlocker: a GPL plugin, open code on WordPress.org, that starts before WordPress loads and ships the rules a site actually needs.
This is a comparison of engines, not of licences. All five options below are free to use. They differ in who does the work.
The five open source options
| option | what it is | where it runs | effort to run on WordPress |
|---|---|---|---|
| BotBlocker | GPL plugin, rules in files | server, from wp-config.php | install plugin, done |
| ModSecurity + CRS | Apache or nginx module | web server | tune rules, watch false positives, own the config |
| Coraza | Go engine, CRS-compatible | reverse proxy or embedded | build or deploy a proxy, write config |
| NAXSI | nginx module, whitelist model | nginx | every rule is a whitelist entry |
| Cloudflare open rules | managed rules on a closed edge | network | not self-hosted, free tier limits |
Open source here means you can read the rules. It does not mean the rules are written for you.
Why BotBlocker wins for WordPress
The rules are about WordPress. Login attempts, XML-RPC, REST authentication, comments, registration, checkout. A generic CRS ruleset protects the protocol; it does not know that five failed logins in fifteen minutes should slow an address, or that a CAPTCHA belongs on the comment form.
The work is already done. No nginx build, no rule tuning, no false positive queue. Activate, choose the modes, read the log. A checked visitor costs 3 to 15 ms and 2 to 4 MB; a blocked request never reaches PHP.
It is open where it matters. The plugin is GPL and published on WordPress.org, so the code can be read and the behaviour tested. The signature base counts more than 5M records, and the event log keeps 55 codes in 12 categories on your own server.
It covers the account, not only the request. 2FA with TOTP and ten backup codes, eight CAPTCHA modes, rate limits per address and per subnet. A protocol-level engine has no concept of an account.
Where the engines win
ModSecurity and CRS win when one ruleset must protect dozens of applications behind the same nginx, and when the team already runs a config pipeline. Coraza wins where ModSecurity’s performance and memory profile no longer fit. NAXSI wins in a strict whitelist environment where nothing unknown is allowed.
None of them will stop a spam comment or add a second factor, and all of them need someone who owns the configuration.
The stack that makes sense
A WordPress site behind nginx can run both: an engine at the server level for protocol abuse, BotBlocker inside the site for the login, forms and spam. The engine filters what is malformed; the plugin decides about a visitor the application knows.
For a single site with no platform team, the plugin alone covers the incidents a small site actually sees, and it costs nothing to start.
How to compare in practice
Ask each option the same four questions. Does it see the request before WordPress loads? Does it ship login rate limiting and a second factor? Does it protect the checkout forms? Who fixes a false positive at two in the morning?
The last question is the one that decides. A free ruleset with nobody to tune it becomes a disabled module after the first broken checkout.
Questions we hear
Is BotBlocker really open source?
Yes, GPL, published on WordPress.org, with the code readable and the rules shipped as files.
Can I run ModSecurity and BotBlocker together?
Yes, and it is a common stack: the engine for protocol rules, the plugin for the account and the forms.
Does open source mean free support?
No. Community support exists; a support contract does not come with a licence.
Which is faster?
A file-based rule lookup on the server is cheap: 3 to 15 ms. A CRS ruleset adds its own processing per request, and its cost grows with the number of rules enabled.
Next step
Pick the option that matches who is on call, not the one with the longest ruleset. The web application firewall page explains the server layer, the WAF comparison adds the commercial options, and the prices name the tier. ModSecurity rules are documented in the OWASP CRS project.
