# Firewall for WordPress

> Block common attacks (SQL injection, script injection, path traversal), bad bots and scrapers, chosen countries and IPs, and slow down clients that hammer…

TW-SEC-06 Security


Block common attacks (SQL injection, script injection, path traversal), bad bots and scrapers, chosen countries and IPs, and slow down clients that hammer the site.

[Get it from $26 a year](https://togglework.app/pricing/#plans) [Try it in the demo](https://togglework.app/demo/)

Firewall

**Part number**
: TW-SEC-06
**Section**
: [Security](https://togglework.app/features/security/)
**Settings**
: 7 (2 on/off)
**Starts**
: Switched off
**In plans**
: Every plan

## Why it matters

Every public WordPress site receives a steady stream of automated attack traffic: requests stuffed with SQL, attempts to read `wp-config.php` through `../` paths, and scanners such as sqlmap and nikto looking for a way in. Most of it fails anyway, but every request still reaches PHP and the database, and the one that finds an unpatched plugin is the one that matters.

A firewall inspects each request before WordPress handles it and drops the obviously malicious ones, so they never get near your plugins.

### What it does

- Blocks common attack patterns: SQL injection, script injection and path traversal.
- Blocks known bad bots and scanners, and requests with no user agent. Search engines are never blocked.
- Blocks IP addresses and ranges you list, with a “never block” list for your own.
- Rate-limits clients that request too many pages a minute (logged-in users are never limited).
- Blocks countries for the whole site or only the login and admin, when your server or Cloudflare reports the visitor’s country.

![Firewall settings screen in the Toggleworks WordPress plugin, showing Block attack patterns, Block bad bots and scanners, Block countries, Country block applies to](https://togglework.app/wp-content/themes/toggleworks-site/assets/img/parts/security-firewall.webp?v=1795524230)

The Firewall screen in wp-admin, where you switch it on and change its settings.

## Set it up

1. Switch Firewall on. Attack patterns and bad-bot blocking are on by default.
2. Add your own IP to **Never block** . The settings screen shows your current address.
3. Optional: set a rate limit (60–120 requests a minute suits most sites) and countries to block from the login page.

## What you can set

Switch Firewall on in Toggleworks → Security, then adjust any of these. Each one starts with a default, so you can switch the part on first and fine-tune later.

- Block attack patterns
- Block bad bots and scanners
- Block countries
- Country block applies to
- Block IPs / ranges
- Never block
- Max requests per minute per IP

## Good to know

- Country blocking needs the visitor’s country from Cloudflare (CF-IPCountry) or a GeoIP-enabled server. Without one, that setting has nothing to work with.
- Keep a host or Cloudflare firewall too if you have one. Layers help: the outer one stops floods, this one sees WordPress-specific requests.
- Set the rate limit generously at first. Shared office networks and some mobile carriers put many people behind one IP.

[Guide: The WordPress security checklist, in the order that matters](https://togglework.app/guides/wordpress-security-checklist/)

## One less plugin to install

Firewall does a job people often install a separate plugin for:

- A web application firewallOften done with Wordfence

## Comes with 187 more parts

Firewall is one part of Toggleworks, a single plugin for security, speed, SEO, backups, email and store tools. Switch on what your site needs; the rest stays off and loads nothing.

[All 18 Security parts](https://togglework.app/features/security/)

### People also look for it as

- firewall
- waf
- block country
- geo block
- bad bots
- ip block
- rate limit
- sql injection

## Often switched on with it

- [Activity Log](https://togglework.app/features/security/activity-log/) — TW-SEC-01 · Keep a record of logins, user and role changes, plugin and theme changes, core updates, content changes and key settings. · 2 settings
- [CAPTCHA](https://togglework.app/features/security/captcha/) — TW-SEC-02 · Stop bots on the login, registration, lost password and comment forms with a simple math question or Cloudflare Turnstile. · 4 settings
- [Content Protection](https://togglework.app/features/security/content-protection/) — TW-SEC-03 · Make casual copying harder: block right click, text selection, copy and paste, image dragging, printing and the view-source /… · 5 settings
- [Custom Login URL](https://togglework.app/features/security/login-url/) — TW-SEC-11 · Move the login page to a secret address and hide wp-login.php and /wp-admin from visitors who are not logged in. Forgot the… · 3 settings
- [Editor Restrictions](https://togglework.app/features/security/editor-restrictions/) — TW-SEC-04 · Let a client, freelancer or team member edit only the pages and posts you pick. Set it on each user’s profile; everything else is… · Own screen in wp-admin
- [Email & Phone Protection](https://togglework.app/features/security/email-protection/) — TW-SEC-05 · Hide email addresses and phone numbers on your pages from spam bots, while visitors still see and click them normally. · 3 settings

## Questions

**Will a firewall block Google or other search engines?**

No. Search engine crawlers are never treated as bad bots, and the rate limit doesn’t apply to logged-in users.

**Do I still need a firewall if I use Cloudflare?**

Cloudflare stops a lot at the edge, and is worth having. It can’t see what happens inside WordPress, though, such as which requests target your plugins or who is logged in. Running both is common and they don’t conflict.

**Is Firewall included in every Toggleworks plan?**

Yes. Every plan includes all 188 parts, Firewall among them. Plans differ only in how many sites you can use them on, and staging or local copies of a site don’t count.

**Does Firewall slow my site down when it’s switched off?**

No. Every part starts switched off, and a part that is off loads none of its code. Switch on Firewall only if your site needs it.

## Switch off the plugin pile.

All 188 parts, one license, updates and support. 14-day refund.

[Choose a plan](https://togglework.app/pricing/#plans) [Try the live demo](https://togglework.app/demo/)

---

Source: https://togglework.app/features/security/firewall/
