How a firewall works

Every click, submitted form or login attempt is a request sent to your website. A web application firewall (WAF) checks each one against rules and known attack patterns. Normal visits get through, suspicious requests are blocked. Examples include an attempt to inject malicious code into the search box, repeated password guessing, or a bot crawling the site en masse.

Where a firewall can run

TypeHow it worksPros and cons
WordPress pluginChecks requests directly on the site, for example Wordfence.Easy to install, but your server carries the load.
At hosting levelRules set on the server.You do not have to do anything, but you have little control.
Cloud serviceRequests pass through a service in front of the site, for example Cloudflare.An attack is stopped before it reaches the server. Often includes a CDN too.

Why it matters

Even a small business website faces hundreds of automated break-in attempts every day. Most fail, but they load the server and slow the site down. A firewall filters them out and also protects you during the window when a newly discovered security flaw does not yet have a fix.

A real-world example

An online shop selling spare parts would occasionally slow down for no obvious reason. The logs showed that at night, bots were trying to log in and probing non-existent URLs thousands of times an hour. After turning on a cloud firewall, these requests stopped reaching the server, and the shop stayed consistently fast even at night when backups ran. A firewall greatly reduces the risk, but if an attacker has already got in, the next step is malware removal.

What not to forget

  • A firewall does not replace updates. It is an extra layer, not the only protection.
  • Overly strict rules can block customers or the payment gateway as well. Test a purchase after switching it on.
  • Combine it with limits on login attempts against brute-force attacks and with 2FA.