Skip to content
Website Security

Website Firewall (WAF) Explained: Types & Choosing

What a web application firewall does, cloud vs plugin vs server firewalls, and how to choose and configure one for your website.

Hero: padlock and shield over a browser address bar showing HTTPS, for “Website Firewall (WAF)”
Quick answer

A web application firewall (WAF) inspects HTTP requests to your website and blocks malicious ones — such as SQL injection, cross-site scripting, bad bots and brute-force logins — before they reach your application. You can use a cloud WAF (Cloudflare, Sucuri), a host-level WAF provided by your hosting company, or a plugin WAF inside WordPress. Cloud WAFs block attacks earliest and reduce server load.

What is a website firewall?

A network firewall controls which ports and IP addresses can reach a server. A web application firewall works at the application layer: it reads each web request and compares it with rules that describe known attacks and suspicious behaviour. Requests that match are blocked, challenged or logged.

What a WAF protects against

Many WAF rule sets are based on the OWASP Core Rule Set and the OWASP Top 10 list of common web application risks.

Types of website firewalls

TypeWhere it runsProsCons
Cloud WAFOn a CDN/proxy before your server (e.g. Cloudflare, Sucuri)Blocks attacks early, reduces server load, includes DDoS protectionRequires DNS changes; origin must be protected from direct access
Host / server WAFOn the hosting server (e.g. ModSecurity, host security layers)No setup for you; covers all sites on the accountLess control; quality varies by host
Plugin WAFInside the CMS (e.g. Wordfence for WordPress)Deep knowledge of the CMS, easy to configureUses server resources; attacks still reach your server

How to choose a WAF

01

Check what your host provides

Many managed hosts already include a WAF and malware scanning.

02

Add a cloud layer if you are a target

Online stores, membership sites and frequently attacked sites benefit from a cloud WAF with DDoS protection.

03

Avoid stacking too many

Two overlapping firewalls can cause false positives and slowdowns. Combine one edge WAF with good updates and login protection.

04

Review logs

Check blocked requests and whitelist legitimate tools (payment gateways, uptime monitors) that get blocked.

Note: A WAF is a safety net, not a replacement for updates. Keep software patched — the firewall buys you time, it does not fix vulnerable code.

Related: Cloudflare, DDoS protection and the security checklist.

How to set up a firewall without breaking your site

01

Take a backup.

02

Start in a monitoring or learning mode if there is one.

03

Use the site normally for a few days: log in, publish, submit forms, place a test order.

04

Read the log and allow anything legitimate that was flagged.

05

Turn on blocking.

06

Make sure you can still reach the admin area, and know how to switch the firewall off if you lock yourself out.

Useful rules for a small site

What a firewall cannot do

It does not fix a vulnerable plugin, clean an infected site or protect a weak password that someone already knows. It buys time. Updates, backups and two-step login are still essential.

False alarms

Sooner or later a firewall blocks a real visitor. Show a short message with a reference number and a way to contact you. Check the log each month for patterns. Compare options in WordPress security plugins.

Keep learning

More in Website Security

Website Security Checklist

A practical, printable website security checklist covering accounts, updates, hosting, backups, HTTPS, monitoring and incident response.

Website Malware

How to tell if your website has malware, how to clean it step by step, how to get off Google’s…

DDoS Protection

What DDoS attacks are, the main types, and how CDNs, firewalls and hosting choices protect your website from going offline.

Latest articles

Related Website Security articles

FAQ

Website Firewall (WAF) questions, answered

Short, honest answers to the questions people ask most about this topic.

Do I need a WAF for a small website?

It is strongly recommended. Automated attacks hit small sites too. Many hosts include a WAF, and Cloudflare’s free plan or a reputable security plugin adds useful protection at low or no cost.

No. A WAF blocks malicious requests before they reach your website. A malware scanner looks for infected files after something gets in. You need both prevention and detection.

Occasionally. Strict rules can cause false positives that block legitimate users or tools. Review logs and adjust or whitelist rules when needed.

Next step

Keep building your skills

Explore the rest of our Website Security guides, or follow the beginner path step by step.