Skip to content

Firewall (Pro)

The firewall checks each request early, before WordPress runs it, and blocks known attack patterns.

Modes

Mode What happens
Off Nothing is checked
Learning mode Requests are checked and logged, but nothing is blocked. Use it first to see what would be caught.
Blocking Matching requests are refused with a 403 page

Start in Learning mode for a few days, look at the log on the Firewall tab, then switch to blocking.

Rules

Each rule can be switched off on its own.

Rule Looks at
SQL injection Address, query and form data
Path traversal Address, query and form data
File inclusion (PHP wrappers) Address, query and form data
Code injection Address, query and form data
Script injection (XSS) Query string
XML-RPC password guessing XML-RPC requests
Scanner probes Addresses that attack tools look for

What it never touches

  • Signed-in administrators, and their addresses: an address an administrator is signed in from now, or signed in from in the last 7 days, is never blocked. A request from one that matches a rule is logged as Admin test, with what would have happened for anyone else ("Would be blocked" or "Would be logged"), so you can test the firewall safely. The addresses are listed under Your IP in the Firewall settings; switch this off with Never block addresses an administrator signed in from in the last 7 days.
  • The server's own requests (WP-Cron, Site Health loopback checks, OG Ai Security's own tests): from 127.0.0.1, ::1 or the server's own address with no proxy headers. A forwarded header that only claims to be 127.0.0.1 is not trusted.
  • Chat and contact form messages people type (they are not checked for attack patterns), payment webhooks and licence calls.
  • Form bodies sent by signed-in editors.

Allow and block lists

  • Never block these IPs: one per line; ranges like 10.0.0.0/8 work. These addresses are never checked.
  • Always block these IPs: addresses or ranges that are always refused. If your own address is on it, nothing is saved, so you cannot lock yourself out.

The log

Recent requests caught lists each caught request with its time, address, rule and what happened: Blocked, Learned (Learning mode) or Admin test. Each row has Never block this IP, and Unblock when the address is on your Always block list. Blocking refuses that one request only; it does not ban the address.

OG Enhanced Login

If OG Enhanced Login is installed, the firewall also blocks every address it has blocked (switch Also block every address OG Enhanced Login has blocked). Add them to Always block now copies its current blocked and locked-out addresses into Always block these IPs, so they stay blocked here. Addresses are read the same way OG Enhanced Login reads them, so the two lists match behind proxies and Cloudflare.

Locked out?

Turn the firewall off without signing in, in either of these ways:

  • Create an empty file wp-content/ogas-firewall-off.
  • Or add define( 'OGAS_FIREWALL_OFF', true ); to wp-config.php.

Remove it again once you have fixed the rule or added your address to Never block these IPs.