Skip to content
WP Cloud
WP Cloud
    • For Hosts
    • For Agencies
    • For Registrars
    • For Native Hosting
    • Performance
    • Security
    • Real-Time Automated Failover
    • Vertical Scaling and Bursting
    • WordPress Management
    • PanelAlpha Integration: White-Label WordPress Control Panel for Hosts
    • EasyEngine Panel Integration: Visual WordPress Management for WP Cloud
    • FAQs
    • WP Cloud API
    • Partner Portal
    • Documentation
    • New Partner Guide
    • Pressable
    • Convesio
    • Porkbun
    • PanelAlpha
    • Ivapix
    • UNC Greensboro
    • Impressive Hosting
    • Blog
    • Performance Benchmarks
  • Connect With Us
  • Login ↗
Start Here ↗
  • Solutions

    • For Hosts
    • For Agencies
    • For Registrars
    • For Native Hosting
    • Featured Partners

    Features

    • Performance
    • Security
    • Real-Time Automated Failover
    • Vertical Scaling and Bursting
    • WordPress Management

    Integrations

    • PanelAlpha Integration
    • Easy Engine Panel Integration

    Resources

    • Documentation
    • WP Cloud API
    • FAQs
    • Partner Portal
    • New Partner Guide
    • Announcements
    • Changelog
  • Case Studies
    • PressableA case study about how WP Cloud supports Pressable to power millions of page views daily.
    • Convesio
    • Porkbun
    • PanelAlpha
    • Ivapix
    • UNC Greensboro
    • Newspack
    • Inverse Paradox
  • Insights
    • Podcast
    • BlogWP Cloud blog page with latest news and updates about the platform.
    • Performance Benchmarks
  • Connect With Us
  • Login ↗
Start Here ↗

Browse

    • WP Cloud platform overview
    • Onboard and launch with WP Cloud
    • WP Cloud Partner Portal
    • Get support from WP Cloud
    • WP Cloud glossary
    • API Documentation
    • Manage and secure API keys
    • Client SSH
    • WP Cloud API quick start
    • Webhooks
    • Run bulk tasks across sites
      • Manage site domains and aliases
      • Domain verification records
      • TLS certificates
      • Manage custom TLS certificates
      • Cloudflare and WP Cloud
    • Clone a site
    • Configure resources, site type, and billing with site meta
    • Delete a site
    • Persistent data
    • Staging sites
    • Migrate a site to WP Cloud
      • SSH and SFTP access models
      • Client SSH
      • User SSH and SFTP access
      • Database credentials
      • phpMyAdmin
      • ABSPATH
      • Default wp-config.php
      • Site constants
      • Configure redirects and headers with custom-redirects.php
      • Akismet and Jetpack
      • Blocked and unsupported plugins
      • PHP lifecycle and supported versions
      • Symlinks and managed software
      • WordPress versions
      • Install Composer and WP-CLI packages
      • Manage platform software with WP-CLI
      • Useful WP-CLI commands
    • Transactional email
    • WordPress multisite
    • Cron scheduling
    • Decoupled and headless WordPress
    • Repair Yoast indexables
      • Edge Cache preload
      • WooCommerce cart caching
      • Page Cache
      • Edge Cache
      • Object Cache
      • Image transformation
      • Offload image sub-sizes
    • Configure lightweight 404s for static files
      • Edge Rules overview
      • Edge Rule types
      • Edge Rule conditions
      • Verify Edge Rules
      • Edge Cache preload
      • WooCommerce cart caching
      • Edge Cache
    • Edge request logs
      • DDoS protection
      • Defensive Mode
      • Rate limiting
      • Network and web application firewalls
      • Bot protection
      • Password protection
      • HTTP and security headers
      • PHP filesystem access permissions
      • Scan a site for malware
    • Backups overview
    • Create an on-demand backup
    • Restore a backup
    • Jetpack backups
      • Error logs
      • Web server logs
      • Edge request logs
    • Usage reporting
    • Metrics
    • Application performance monitoring
    • Automated failover
    • IP ranges
    • Origin and edge servers
    • Server specifications and settings
    • EasyEngine integration
    • PanelAlpha integration
      • White labelling and co-marketing WP Cloud
      • WP Cloud logos
      • Terms of Service & Compliance
      • Prohibited content
      • Copyright infringement and takedown notifications
    • WP Cloud billing
    • WP Cloud for agencies and site networks
    • WP Cloud partner support options
    • Troubleshoot Page and Edge Cache
    • Troubleshoot HTTP 429 and 599 errors
    • WP Cloud HTTP status codes
    • Troubleshoot site performance
    • Cache slow database queries
    • Troubleshoot duplicate core files, wp-config.php, and wp-admin 403 errors
    • Troubleshoot email delivery
    • Troubleshoot PDF thumbnail generation
    • Troubleshoot TLS certificate provisioning

Updates

  • Changelog
  • WP Cloud Status
  • Announcements
Documentation/Edge/Edge Rules/Edge Rule types

Edge Rule types

LAST UPDATED

1 month ago

    Closed beta: Edge Rules is available only to enabled WP Cloud partner accounts. This documentation is a preview. Requests from accounts that are not enabled receive HTTP 403. Partners without access can contact WP Cloud Support to express interest in exploring or testing it.

    Each Edge Rule uses a catalog type identified by rule_key. Retrieve the Edge Rule catalog for the types available to your API key. Its input_schema, defaults, and constraints are the current input contract.

    The examples below are rule bodies, not complete HTTP requests. Send them as form fields, with rule_definition encoded as a JSON string. Follow the create-and-verify procedure, validate before saving, and check the effect on legitimate traffic.

    Type rule_key Phase Catalog risk
    Security fence managed.security_fence Security High
    IP allowlist managed.ip_allowlist Security High
    Redirect managed.redirect Redirect Medium
    Rewrite managed.rewrite Rewrite Medium
    Request header managed.request_header Request headers Low
    Response header managed.response_header Response headers Low
    Cache bypass managed.cache_bypass Cache Medium
    Ignore query args in cache managed.cache_ignore_args Cache Medium

    Catalog entries also provide supported scopes, a verification method, and any verification_note. Use the conditions reference for shared matching fields and operators.

    Security fence

    Security fences block or challenge matching requests. action=block returns a status_code from 400 through 499, defaulting to 403. Set status_code only for a block action.

    action=challenge uses browser proof-of-work. The normal Defensive Mode crawler exceptions also apply to challenge Edge Rules. Requests that receive a challenge must complete it before proceeding.

    At least one condition is required. condition_logic is all by default or can be any. Conditions can select IP addresses, networks, countries, Autonomous System Numbers (ASNs), TLS fingerprints, URLs, methods, or request headers.

    A broad rule can block legitimate customers, partner support teams, API integrations, and monitors. Review login, checkout, and webhook flows before using a broad condition. Automated clients that cannot complete a challenge will not reach the site.

    This example challenges requests under /shop/ that contain an add_to_cart query parameter and no Referer header. The parameter name is the example’s chosen key. Match the key used by your application.

    {
      "rule_name": "challenge-cart-crawls",
      "rule_key": "managed.security_fence",
      "rule_definition": {
        "version": 1,
        "input": {
          "action": "challenge",
          "conditions": [
            {"field": "http.path", "op": "wildcard", "value": "/shop/*"},
            {"field": "http.query.param", "key": "add_to_cart", "op": "exists"},
            {"field": "http.referer", "op": "exists", "negate": true}
          ]
        }
      }
    }Code language: JSON / JSON with Comments (json)

    This example blocks /wp-login.php requests from outside US and CA. Those countries are illustrative, not a recommended policy. Test support access and legitimate logins from other locations before applying such a rule.

    {
      "rule_name": "geo-limit-login",
      "rule_key": "managed.security_fence",
      "rule_definition": {
        "version": 1,
        "input": {
          "action": "block",
          "conditions": [
            {"field": "http.path", "op": "starts_with", "value": "/wp-login.php"},
            {"field": "geo.country", "op": "in", "values": ["US", "CA"], "negate": true}
          ]
        }
      }
    }Code language: JSON / JSON with Comments (json)

    IP allowlist

    IP allowlist rules let trusted IP addresses skip later partner security rules. action=skip_challenge stops challenges for matching requests, but block rules still apply. action=allow ends security evaluation, so later partner block and challenge rules do not run.

    Supply ips as a list of up to 100 IP addresses or CIDR ranges. IPv4 ranges must be /24 or narrower, and IPv6 ranges must be /48 or narrower. A bare address is stored as /32 or /128. Conditions are optional. When supplied, they narrow the match and combine with the IP match using AND.

    WP Cloud-owned rules always run before partner rules, so an allowlist cannot skip them. The catalog marks this type’s effect as not measurable from a response.

    This example lets an office address and a monitoring range skip all later partner security rules for REST API requests:

    {
      "rule_name": "allow-office-rest-api",
      "rule_key": "managed.ip_allowlist",
      "rule_definition": {
        "version": 1,
        "input": {
          "action": "allow",
          "ips": ["203.0.113.10", "198.51.100.0/24"],
          "conditions": [
            {"field": "http.path", "op": "starts_with", "value": "/wp-json/"}
          ]
        }
      }
    }Code language: JSON / JSON with Comments (json)

    Redirect

    A redirect sends matching requests to target_url. The target must be an absolute HTTP(S) URL or a path beginning with /. It can include {{field}} placeholders filled in at request time: http.path, http.uri, http.query, http.path.extension, http.method, geo.country, and geo.asn. For example, https://new.example.com{{http.path}} keeps the request path.

    Allowed status_code values are 301 (default), 302, 307, and 308. preserve_query defaults to true, appending the request’s query string to the target. At least one condition must use http.host, http.path, or http.uri.

    Set preserve_query=false when using {{http.uri}} or {{http.query}}, because those fields already include the query string.

    A target equal to the matched path is rejected. Targets with placeholders are not checked for redirect loops. Make sure the redirected request cannot match the rule again. When redirecting between domains on the same site, add an http.host condition or use domain scope.

    This example redirects a retired product URL to its replacement:

    {
      "rule_name": "legacy-widget-redirect",
      "rule_key": "managed.redirect",
      "rule_definition": {
        "version": 1,
        "input": {
          "conditions": [
            {"field": "http.path", "op": "eq", "value": "/products/legacy-widget"}
          ],
          "target_url": "/products/widget-2"
        }
      }
    }Code language: JSON / JSON with Comments (json)

    Rewrite

    A rewrite changes the path or query sent to the origin while leaving the visitor’s URL unchanged. Supply at least one of path or query. A replacement path must start with /. A query string excludes the leading ?. A rewrite that leaves the request unchanged is rejected.

    This example serves a campaign page at a different public path:

    {
      "rule_name": "spring-sale-rewrite",
      "rule_key": "managed.rewrite",
      "rule_definition": {
        "version": 1,
        "input": {
          "conditions": [
            {"field": "http.path", "op": "eq", "value": "/spring-sale"}
          ],
          "path": "/campaigns/2026-spring",
          "query": "utm_source=edge"
        }
      }
    }Code language: JSON / JSON with Comments (json)

    Request header

    Request-header rules set or remove headers on requests sent to the origin. Their changes are visible at the origin, rather than in the response received by the visitor.

    Set operation to set or remove. For set, supply one header name and a value. For remove, supply a header name or an array of up to 32 names. The edge does not permit setting restricted destination headers such as Host, Authorization, or Cookie.

    A set value can be a literal or one whole-value placeholder. For example, {{geo.country}} uses the visitor’s country and {{http.header:x-request-id}} copies a named request header. Use the catalog’s matchers.placeholders list. Placeholders cannot be concatenated with text.

    This example passes the visitor’s country to the origin for one host:

    {
      "rule_name": "visitor-country-header",
      "rule_key": "managed.request_header",
      "rule_definition": {
        "version": 1,
        "input": {
          "operation": "set",
          "header": "X-Visitor-Country",
          "value": "{{geo.country}}",
          "conditions": [
            {"field": "http.host", "op": "eq", "value": "shop.example.com"}
          ]
        }
      }
    }Code language: JSON / JSON with Comments (json)

    Response header

    Response-header rules set or remove headers sent to the visitor. operation is set or remove. Set one header with header and a literal value. Placeholders are not supported. A remove operation accepts one name or an array of up to 32 names. Framing and security-critical headers cannot be removed.

    This example sends an indexing directive for PDF paths:

    {
      "rule_name": "noindex-pdfs",
      "rule_key": "managed.response_header",
      "rule_definition": {
        "version": 1,
        "input": {
          "operation": "set",
          "header": "X-Robots-Tag",
          "value": "noindex, nofollow",
          "conditions": [
            {"field": "http.path.extension", "op": "eq", "value": "pdf"}
          ]
        }
      }
    }Code language: JSON / JSON with Comments (json)

    Cache bypass

    Cache-bypass rules skip Edge Cache for matching requests, sending them to the origin. At least one condition is required. The rule does not set cache time to live (TTL) or change cache keys. Use a response-header rule for cache-related headers sent to the visitor.

    The origin’s Page Cache remains a separate layer. An edge bypass does not prove that PHP handled the request or that every cache was bypassed.

    This example bypasses Edge Cache for account-area paths:

    {
      "rule_name": "no-cache-account",
      "rule_key": "managed.cache_bypass",
      "rule_definition": {
        "version": 1,
        "input": {
          "conditions": [
            {"field": "http.path", "op": "starts_with", "value": "/my-account"}
          ]
        }
      }
    }Code language: JSON / JSON with Comments (json)

    Ignore query args in cache

    These rules leave named query parameters out of the Edge Cache key for matching requests, so pages that differ only in those parameters share one cached copy. The origin still receives the full query string.

    Supply args as a list of one to 150 parameter names. Names are matched exactly as written: case-sensitive and not percent-decoded. ignore=value drops only the value, so pages with and without the parameter are still cached separately. ignore=arg drops the whole parameter, so the page without it shares the copy too.

    At least one condition is required. Use http.path starts_with / to match the whole site.

    Ignore a parameter only when the page does not depend on it. The first value cached is served for every other value until the copy expires. Tracking IDs and campaign tags are suitable. Search terms, pagination, and anything the page renders are not.

    This example shares one cached copy across referral and campaign parameters for the whole site:

    {
      "rule_name": "ignore-tracking-args",
      "rule_key": "managed.cache_ignore_args",
      "rule_definition": {
        "version": 1,
        "input": {
          "args": ["ref", "utm_campaign"],
          "ignore": "value",
          "conditions": [
            {"field": "http.path", "op": "starts_with", "value": "/"}
          ]
        }
      }
    }Code language: JSON / JSON with Comments (json)

    Other catalog types may have no inputs or require separate enablement. Follow the returned schema for each entry. Use Verify Edge Rules for response, origin, and traffic checks.

    Previous Edge Rules overview
    Next Edge Rule conditions

    Related Guides

    • Edge Rules overview

      Configure, manage, and roll back closed-beta Edge Rules at site or domain scope through the…

      8 Min.

      READ

    • Edge Rule conditions

      Look up closed-beta Edge Rule condition fields, operators, limits, and request-header placeholders.

      4 Min.

      READ

    • Verify Edge Rules

      Confirm closed-beta Edge Rule deployment and verify its effect on matching and legitimate requests.

      6 Min.

      READ

    On this page

      Contact support

      Contact us with Support issues and questions related to WP Cloud, the WP Cloud Atomic API, API-key IP allow list changes, Station, and more.

      Check the FAQs

      Have questions? Please visit our FAQ to learn more.

      An Automattic venture

      Work With Us

      Press

      Privacy Policy

      © 2021-2026 Automattic Inc.

      Notifications