Firewall
A site's web application firewall. For the same in the control panel, see Protect a site with the firewall.
Operations
| Operation | Request |
|---|---|
| Get a site's firewall | GET / |
| Change a site's firewall settings | PUT / |
| Allow or block an IP address on a site | POST / |
| Add a firewall exception for a false alarm | POST / |
| Remove an address or exception from a firewall | DELETE / |
| Apply a site's firewall settings again | POST / |
| List the requests a site's firewall stopped | GET / |
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.
| Field | Type and description |
|---|---|
mode | string
Known values: |
sensitivity | string
Known values: |
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: Known values: |
lastError | string or null Why the settings couldn't be put in place (with |
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
Known values: |
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 |
path | string or null Where an exception applies: this page and the pages under it ( |
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
{
"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.
| Field | Type 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 |
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 |
matchedRules | array of objects The firewall rules the request matched. |
ruleId | integer The rule's number: an exception ( |
message | string What the rule found. |
Example
{
"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)"
}
]
}