
A web application firewall (WAF) is a filter that sits in front of your website and inspects the content of each incoming request, blocking ones that match known attack patterns such as SQL injection, cross-site scripting and automated login attacks. Most websites with forms, logins or an online shop benefit from one. A WAF reduces risk, but it does not replace updates, strong passwords and backups.
How a WAF works
Every time someone loads a page, submits a form, searches or logs in, their browser sends an HTTP request to your server. That request contains a URL, headers and sometimes data such as a username, a comment or an uploaded file.
A WAF examines those requests before they reach your website’s code. It compares them against rules that describe malicious behaviour, and it can also look at patterns over time, such as one address trying hundreds of passwords a minute. Then it decides:
- Allow requests that look normal. This is the vast majority of traffic.
- Block requests that match an attack rule.
- Challenge suspicious traffic, for example with a browser check, so real people pass and simple bots do not.
- Log what it saw, so you can review attacks and tune the rules.
How a WAF differs from a network firewall
A traditional network firewall works at a lower level. It decides which connections are allowed at all, based on IP addresses, ports and protocols. It might allow web traffic on ports 80 and 443 and block everything else. It does not look inside that web traffic.
A WAF works at the application layer. It assumes the web connection is allowed and checks whether what is being sent is safe. The two are complementary. A server should have both.
What a WAF protects against
- SQL injection: database commands hidden in form fields or URLs, aimed at reading or changing your data.
- Cross-site scripting (XSS): malicious scripts inserted into comments, search boxes or other input, which then run in visitors’ browsers.
- Brute-force and credential-stuffing attacks: automated attempts to guess logins, often on WordPress, webmail or admin pages.
- Exploits for known vulnerabilities: requests targeting a published flaw in a plugin, theme or application, sometimes blocked before you have had time to update.
- Bad bots and scanners: automated tools probing for weaknesses or scraping content.
- Some application-layer floods: large numbers of requests designed to exhaust your server, when the WAF is combined with rate limiting and DDoS protection.
Many WAFs use widely known rule sets, such as the OWASP Core Rule Set, alongside rules maintained by the provider.
What a WAF does not do
- It does not patch outdated software. A vulnerable plugin is still vulnerable; the WAF only makes it harder to reach.
- It does not stop someone logging in with a stolen password that is correct.
- It does not remove malware already on your site.
- It does not replace backups.
- It can occasionally block legitimate requests, known as false positives, which need someone to adjust the rules.
Types of WAF
Cloud or edge WAF
Runs on a provider’s network in front of your server, usually as part of a CDN. Traffic passes through the provider first, so attacks are filtered before they use your server’s resources. Setup normally means changing your domain’s DNS. Cloudflare is a common example.
Server-level WAF
Runs on the web server itself, for example ModSecurity rules or security software such as Imunify360. It protects every site on the server but uses the server’s own resources.
Application plugin WAF
Runs inside the application, such as a WordPress security plugin. Easy to install, but the request has already reached your site before it is checked.
Do you need one?
You should strongly consider a WAF if your site:
- Has logins, forms, comments or search.
- Runs WordPress or another popular CMS with plugins.
- Takes payments or stores customer data.
- Would cost you money or reputation if it went down or was defaced.
- Has been hacked or attacked before.
A simple static site with no forms and no CMS faces fewer application attacks, though a CDN with basic protection is still useful for speed and DDoS resilience.
WAF options at Tremhost
- All cPanel web hosting plans include Imunify360 server-level security with malware scanning.
- Armor Guard puts your site behind Cloudflare Pro, including Cloudflare’s WAF with the Cloudflare Managed Ruleset and OWASP Core Ruleset, set up and monitored by Tremhost, for $9 a month or $90 a year per site. It works with any hosting.
- Armor Shield provides Cloudflare Business for sites that cannot afford downtime, at $200 a month.
- A free 15-day Cloudflare Pro or Business trial is available, with no card needed.
If your site is already infected, a WAF will not clean it. Tremhost’s Armor SOS offers free same-day triage for hacked sites, then quotes the cleanup.
Frequently asked questions
Is a WAF the same as antivirus?
No. A WAF filters incoming web requests. Antivirus and malware scanners look for malicious files already on a server or device.
Will a WAF slow my website down?
A well-run WAF adds very little delay. A cloud WAF combined with a CDN often makes pages faster overall, because cached content is served from a location near the visitor.
Does WordPress need a WAF?
It benefits from one, because WordPress sites are common targets for login attacks and plugin exploits. Keep WordPress and plugins updated as well.
Can I try a WAF before paying?
Yes. Tremhost offers a free 15-day Cloudflare Pro trial with no card required.
Next step
To put a managed WAF in front of your site, see Tremhost Armor Guard, or start with the free trial.


