Skip to content

Firewall

A site's web application firewall. For the same in the control panel, see Protect a site with the firewall.

Operations

OperationRequest
Get a site's firewall GET /v1/sites/{siteId}/firewall
Change a site's firewall settings PUT /v1/sites/{siteId}/firewall
Allow or block an IP address on a site POST /v1/sites/{siteId}/firewall/addresses
Add a firewall exception for a false alarm POST /v1/sites/{siteId}/firewall/exceptions
Remove an address or exception from a firewall DELETE /v1/sites/{siteId}/firewall/rules/{ruleId}
Apply a site's firewall settings again POST /v1/sites/{siteId}/firewall/actions/apply
List the requests a site's firewall stopped GET /v1/sites/{siteId}/firewall/events

The SiteFirewall object

A site's web application firewall: it checks every request before WordPress runs it and stops SQL injection, cross-site scripting, file and code injection, known exploits and hacking tools. Included on every plan.

FieldType and description
mode

string

protect: attacks are blocked before WordPress sees them (new sites start so). monitor: every request is checked and attacks are logged, but nothing is blocked. off: requests reach WordPress unchecked (blocked addresses are still refused).

Known values: offmonitorprotect More can appear.

sensitivity

string

standard (recommended): stops known attacks with very few false alarms. strict: catches subtler attacks too, but may flag some plugins (add exceptions if it does).

Known values: standardstrict More can appear.

loginProtection

boolean

Whether repeated sign-ins from one address are slowed down (after a few quick tries, one every 6 seconds), so password-guessing bots can't hammer wp-login.php. It works while the firewall is on.

status

string

Whether the settings are in place on the site's server: off, installing (the firewall is being set up on the server first, a few minutes), applying (the latest settings are on their way, usually seconds), active, or failed (see lastError; apply them again with POST /sites/{siteId}/firewall/actions/apply).

Known values: offinstallingapplyingactivefailed More can appear.

lastError

string or null

Why the settings couldn't be put in place (with status: "failed"). Null otherwise.

updatedAt

string or null An ISO 8601 time, in UTC

When the settings or rules last changed. Null when they never did.

rules

array of objects

The site's allowed addresses (up to 100), blocked addresses (up to 500) and exceptions (up to 30), oldest first.

id

string

The rule's id.

kind

string

allow: requests from address skip the firewall's checks. block: requests from address are refused on every page of the site. exception: the rules in ruleIds stop checking requests (on path and the pages under it, or everywhere when path is null).

Known values: allowblockexception More can appear.

address

string or null

The IP address or range, like 203.0.113.7 or 203.0.113.0/24, written as the firewall uses it (a range from its first address). Null for an exception.

ruleIds

array of integers

The firewall rules an exception turns off, by number (as an event's matchedRules names them). Empty for an address.

path

string or null

Where an exception applies: this page and the pages under it (/ is the front page only). Null: everywhere on the site, and always for an address.

note

string or null

The note given when it was added. Null when none was.

createdAt

string An ISO 8601 time, in UTC

When the rule was added.

Example

The SiteFirewall object
{
  "mode": "protect",
  "sensitivity": "standard",
  "loginProtection": true,
  "status": "active",
  "lastError": null,
  "updatedAt": "2026-11-18T09:31:17.000Z",
  "rules": [
    {
      "id": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",
      "kind": "block",
      "address": "198.51.100.0/24",
      "ruleIds": [],
      "path": null,
      "note": "Login attempts from a scanner",
      "createdAt": "2026-11-18T09:20:03.000Z"
    },
    {
      "id": "f2a3b4c5-d6e7-4f8a-9b0c-1d2e3f4a5b6c",
      "kind": "exception",
      "address": null,
      "ruleIds": [
        942270,
        942360
      ],
      "path": "/wp-admin/admin-ajax.php",
      "note": "Page builder saves",
      "createdAt": "2026-11-18T09:31:17.000Z"
    }
  ]
}

The FirewallEvent object

A request the site's firewall blocked or flagged.

FieldType and description
id

string

The event's id.

occurredAt

string or null An ISO 8601 time, in UTC

When the request came. Null when not known.

ip

string

The IP address the request came from.

method

string

The request's HTTP method, like GET or POST.

path

string

The page asked for, without its query string.

hasQuery

boolean

Whether the address had a query string (left out of path).

blocked

boolean

Whether the firewall blocked it. False: it was flagged and logged, but let through (in Monitor mode, for example).

httpStatus

integer

The HTTP status the site answered (403 when blocked).

score

integer or null

How suspicious the request looked: the total weight of the rules it matched. Null when not known.

userAgent

string or null

The browser or tool the request said it came from. Null when it sent none.

category

string

What kind of attack it looked like, in words: for example SQL injection, Cross-site scripting (XSS) or Suspicious request.

matchedRules

array of objects

The firewall rules the request matched.

ruleId

integer

The rule's number: an exception (POST /sites/{siteId}/firewall/exceptions) can turn it off for a false alarm.

message

string

What the rule found.

Example

The FirewallEvent object
{
  "id": "aZq3Lk2mVt9Xw4Rn7Pb1",
  "occurredAt": "2026-11-18T10:02:44.000Z",
  "ip": "198.51.100.23",
  "method": "GET",
  "path": "/shop/",
  "hasQuery": true,
  "blocked": true,
  "httpStatus": 403,
  "score": 10,
  "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)",
  "category": "SQL injection",
  "matchedRules": [
    {
      "ruleId": 942270,
      "message": "Looking for basic SQL injection. Common attack string for MySQL, Oracle and others"
    },
    {
      "ruleId": 949110,
      "message": "Inbound Anomaly Score Exceeded (Total Score: 10)"
    }
  ]
}

Popular

API docs