What a WAF does
Every visit to a WordPress site is an HTTP request: an address, parameters, cookies, headers and sometimes a body, such as a form or a file upload. A web application firewall reads each request before the site’s code does and compares it with rules that describe attacks. A request that matches is refused, usually with a 403 Forbidden, and never reaches PHP or the database.
Typical rules catch:
- SQL injection: database commands hidden in a parameter.
- Cross-site scripting: a script smuggled into a field that will be shown to other visitors.
- Path traversal:
../../sequences that try to read files such aswp-config.php. - File upload tricks: PHP hidden inside an image, or a
.htaccessfile uploaded to change how the server runs files. - Known plugin holes: the exact request that reaches a vulnerable function in a named plugin. Rules like this are called virtual patches.
- Bad bots: scanners and aggressive crawlers that only cost the server time.
Two places a WAF can run
In the cloud. The site’s DNS points at the WAF provider, so traffic passes through its network first. Bad requests are dropped before they cost your server anything, and you often get a CDN in the same service. The weak point: if someone finds the server’s own address, they can send requests straight to it and skip the firewall, unless the server only accepts traffic from the provider.
On the site. The firewall loads before WordPress, in the same PHP process, through PHP’s auto_prepend_file setting or a must-use plugin in wp-content/mu-plugins, which WordPress loads before every other plugin. It sees every request however it arrives, and it can use what it knows about the site: which plugins are installed, which forms exist, who is signed in. It runs on your server, so each request pays a small cost.
Many sites use both: a cloud layer against floods and bots, and a firewall on the site for rules that need to know the site.
What to look for in a WAF for client sites
- Rules for the holes in the plugins your sites run, not only generic attack patterns.
- A learning period: a new site logs what would be blocked for a while before blocking anything, so a client’s checkout or booking form is never refused on day one.
- A log you can read and show the client: what was blocked, when and why.
- A way to check it works: a harmless test request that should be refused, sent from outside.
- Allowlists for the agency’s own addresses and the client’s office.
How Keptstone handles it
On the Care + Protect + Speed plan ($4 a site a month), Keptstone’s firewall loads from a must-use plugin before every other plugin on each site. A new site learns for 14 days, logging every match and blocking only the agency’s own blocklist, then starts blocking by itself. It carries Keptstone’s patches for the holes found on the sites it looks after, blocks known bad crawlers, and keeps a log the agency can see per site. Keptstone also sends a harmless test attack from outside and shows whether the firewall answered it with a 403.
Questions
Does a WordPress site need a WAF if it is kept up to date?
Updates fix holes once a fix exists. A WAF covers the time before that, blocks automated attacks and scans that probe every site, and protects plugins that are slow to ship a fix.
Cloud WAF or a WAF on the site?
A cloud WAF stops traffic before it reaches your server and often comes with a CDN, but attackers can go around it if they find the server's own address. A WAF on the site sees every request, whichever way it arrives, and can tailor its rules to the plugins the site runs.
Can a WAF block real visitors?
Yes, if a rule is too broad. That is why a good WAF starts by logging what it would block, so you can see false alarms before it blocks anything.
Is a WAF the same as a security plugin?
Not quite. Many security plugins include a WAF, plus login protection, scans and hardening. The WAF is the part that reads each request and decides whether it may reach the code.