{"id":1367,"date":"2025-11-05T16:05:20","date_gmt":"2025-11-05T13:05:20","guid":{"rendered":"https:\/\/www.dchost.com\/blog\/can-cloudflare-waf-and-rate-limiting-actually-stop-wordpress-bots-heres-the-playbook-i-use\/"},"modified":"2026-11-04T21:43:11","modified_gmt":"2026-11-04T18:43:11","slug":"wordpress-cloudflare-waf-rate-limiting","status":"publish","type":"post","link":"https:\/\/www.dchost.com\/blog\/en\/wordpress-cloudflare-waf-rate-limiting\/","title":{"rendered":"Cloudflare WAF and Rate Limiting for WordPress"},"content":{"rendered":"<div class=\"dchost-blog-content-wrapper\"><p>Abusive bot traffic can slow WordPress and WooCommerce even when legitimate traffic is steady. Cloudflare WAF and rate limiting can reject unwanted requests before they reach the origin. Effective protection depends on identifying the affected endpoints and preserving login, checkout and integration flows.<\/p>\n<p>This guide explains managed rules, custom expressions, endpoint-specific rate limits and a test-and-rollback process. The numerical limits are examples for evaluation, not universal recommendations or results from a customer deployment. Check current plan features and your site\u2019s request patterns before enabling a rule.<\/p>\n<div id=\"toc_container\" role=\"navigation\" aria-label=\"Table of Contents\" data-nosnippet class=\"toc_transparent no_bullets toc_numbered toc_title_center\"><p class=\"toc_title\">\u0130\u00e7indekiler<\/p><ul class=\"toc_list\"><li><a href=\"#Why_WordPress_Attracts_Abusive_Traffic\"><span class=\"toc_number toc_depth_1\">1.<\/span> Why WordPress Attracts Abusive Traffic<\/a><\/li><li><a href=\"#The_Foundation_How_Cloudflare_Sees_WordPress_Traffic\"><span class=\"toc_number toc_depth_1\">2.<\/span> The Foundation: How Cloudflare Sees WordPress Traffic<\/a><ul><li><a href=\"#What_the_Edge_Can_Evaluate\"><span class=\"toc_number toc_depth_2\">2.1.<\/span> What the Edge Can Evaluate<\/a><\/li><li><a href=\"#Check_Proxying_Origin_Access_and_Critical_Flows\"><span class=\"toc_number toc_depth_2\">2.2.<\/span> Check Proxying, Origin Access and Critical Flows<\/a><\/li><\/ul><\/li><li><a href=\"#WordPress_Endpoints_and_Their_Requirements\"><span class=\"toc_number toc_depth_1\">3.<\/span> WordPress Endpoints and Their Requirements<\/a><ul><li><a href=\"#1_Login_Requests\"><span class=\"toc_number toc_depth_2\">3.1.<\/span> 1) Login Requests<\/a><\/li><li><a href=\"#2_XML-RPC_Integrations\"><span class=\"toc_number toc_depth_2\">3.2.<\/span> 2) XML-RPC Integrations<\/a><\/li><li><a href=\"#3_REST_API_and_Store_API\"><span class=\"toc_number toc_depth_2\">3.3.<\/span> 3) REST API and Store API<\/a><\/li><li><a href=\"#4_Public_AJAX_Handlers\"><span class=\"toc_number toc_depth_2\">3.4.<\/span> 4) Public AJAX Handlers<\/a><\/li><\/ul><\/li><li><a href=\"#Cloudflare_WAF_Rules_for_WordPress\"><span class=\"toc_number toc_depth_1\">4.<\/span> Cloudflare WAF Rules for WordPress<\/a><ul><li><a href=\"#Login_Matching_vs_Counting\"><span class=\"toc_number toc_depth_2\">4.1.<\/span> Login: Matching vs Counting<\/a><\/li><li><a href=\"#Block_Unused_XML-RPC\"><span class=\"toc_number toc_depth_2\">4.2.<\/span> Block Unused XML-RPC<\/a><\/li><li><a href=\"#Restrict_Staff_Administration_Carefully\"><span class=\"toc_number toc_depth_2\">4.3.<\/span> Restrict Staff Administration Carefully<\/a><\/li><li><a href=\"#Target_Specific_REST_Routes\"><span class=\"toc_number toc_depth_2\">4.4.<\/span> Target Specific REST Routes<\/a><\/li><li><a href=\"#Scope_Verified-Bot_Exceptions\"><span class=\"toc_number toc_depth_2\">4.5.<\/span> Scope Verified-Bot Exceptions<\/a><\/li><\/ul><\/li><li><a href=\"#Rate_Limiting_for_WordPress_and_WooCommerce\"><span class=\"toc_number toc_depth_1\">5.<\/span> Rate Limiting for WordPress and WooCommerce<\/a><ul><li><a href=\"#Plan_Limits_and_Counter_Scope\"><span class=\"toc_number toc_depth_2\">5.1.<\/span> Plan Limits and Counter Scope<\/a><\/li><li><a href=\"#Login_Rate_Limit\"><span class=\"toc_number toc_depth_2\">5.2.<\/span> Login Rate Limit<\/a><\/li><li><a href=\"#Rate_Limiting_Required_XML-RPC\"><span class=\"toc_number toc_depth_2\">5.3.<\/span> Rate Limiting Required XML-RPC<\/a><\/li><li><a href=\"#REST_API_and_WooCommerce\"><span class=\"toc_number toc_depth_2\">5.4.<\/span> REST API and WooCommerce<\/a><\/li><li><a href=\"#Action-Specific_AJAX_Limits\"><span class=\"toc_number toc_depth_2\">5.5.<\/span> Action-Specific AJAX Limits<\/a><\/li><li><a href=\"#Tuning_Actions_and_Rule_Order\"><span class=\"toc_number toc_depth_2\">5.6.<\/span> Tuning Actions and Rule Order<\/a><\/li><\/ul><\/li><li><a href=\"#Testing_and_Observability\"><span class=\"toc_number toc_depth_1\">6.<\/span> Testing and Observability<\/a><ul><li><a href=\"#Check_Preview_and_Logging_Availability\"><span class=\"toc_number toc_depth_2\">6.1.<\/span> Check Preview and Logging Availability<\/a><\/li><li><a href=\"#Inspect_Security_Events\"><span class=\"toc_number toc_depth_2\">6.2.<\/span> Inspect Security Events<\/a><\/li><li><a href=\"#Review_Public_Crawler_Access\"><span class=\"toc_number toc_depth_2\">6.3.<\/span> Review Public Crawler Access<\/a><\/li><li><a href=\"#Correlate_Edge_and_Origin_Logs\"><span class=\"toc_number toc_depth_2\">6.4.<\/span> Correlate Edge and Origin Logs<\/a><\/li><li><a href=\"#Choose_a_Review_Schedule\"><span class=\"toc_number toc_depth_2\">6.5.<\/span> Choose a Review Schedule<\/a><\/li><\/ul><\/li><li><a href=\"#Compatibility_and_Deployment_Pitfalls\"><span class=\"toc_number toc_depth_1\">7.<\/span> Compatibility and Deployment Pitfalls<\/a><ul><li><a href=\"#Test_the_Actual_Checkout_Flow\"><span class=\"toc_number toc_depth_2\">7.1.<\/span> Test the Actual Checkout Flow<\/a><\/li><li><a href=\"#Keep_Caching_and_WAF_Roles_Clear\"><span class=\"toc_number toc_depth_2\">7.2.<\/span> Keep Caching and WAF Roles Clear<\/a><\/li><li><a href=\"#Do_Not_Trust_User_Agents_Alone\"><span class=\"toc_number toc_depth_2\">7.3.<\/span> Do Not Trust User Agents Alone<\/a><\/li><li><a href=\"#Use_Country_and_ASN_Filters_Carefully\"><span class=\"toc_number toc_depth_2\">7.4.<\/span> Use Country and ASN Filters Carefully<\/a><\/li><li><a href=\"#Check_Bot_Product_Capabilities\"><span class=\"toc_number toc_depth_2\">7.5.<\/span> Check Bot Product Capabilities<\/a><\/li><li><a href=\"#Retire_Obsolete_Threat-Score_Rules\"><span class=\"toc_number toc_depth_2\">7.6.<\/span> Retire Obsolete Threat-Score Rules<\/a><\/li><\/ul><\/li><li><a href=\"#Deployment_Checklist\"><span class=\"toc_number toc_depth_1\">8.<\/span> Deployment Checklist<\/a><ul><li><a href=\"#1_Check_Available_Managed_Rules\"><span class=\"toc_number toc_depth_2\">8.1.<\/span> 1) Check Available Managed Rules<\/a><\/li><li><a href=\"#2_Select_Custom_Controls\"><span class=\"toc_number toc_depth_2\">8.2.<\/span> 2) Select Custom Controls<\/a><\/li><li><a href=\"#3_Select_Endpoint-Specific_Rate_Limits\"><span class=\"toc_number toc_depth_2\">8.3.<\/span> 3) Select Endpoint-Specific Rate Limits<\/a><\/li><li><a href=\"#4_Test_Application_Flows\"><span class=\"toc_number toc_depth_2\">8.4.<\/span> 4) Test Application Flows<\/a><\/li><li><a href=\"#5_Observe_and_Adjust\"><span class=\"toc_number toc_depth_2\">8.5.<\/span> 5) Observe and Adjust<\/a><\/li><\/ul><\/li><li><a href=\"#Application_and_Integration_Controls\"><span class=\"toc_number toc_depth_1\">9.<\/span> Application and Integration Controls<\/a><ul><li><a href=\"#Preserve_Required_Services\"><span class=\"toc_number toc_depth_2\">9.1.<\/span> Preserve Required Services<\/a><\/li><li><a href=\"#Keep_WordPress_Updated\"><span class=\"toc_number toc_depth_2\">9.2.<\/span> Keep WordPress Updated<\/a><\/li><li><a href=\"#Validate_Turnstile_on_the_Server\"><span class=\"toc_number toc_depth_2\">9.3.<\/span> Validate Turnstile on the Server<\/a><\/li><li><a href=\"#Document_Expected_Behavior_and_Recovery\"><span class=\"toc_number toc_depth_2\">9.4.<\/span> Document Expected Behavior and Recovery<\/a><\/li><\/ul><\/li><li><a href=\"#Hypothetical_Store_Tuning_Scenario\"><span class=\"toc_number toc_depth_1\">10.<\/span> Hypothetical Store Tuning Scenario<\/a><\/li><li><a href=\"#Measure_Security_and_Performance_Together\"><span class=\"toc_number toc_depth_1\">11.<\/span> Measure Security and Performance Together<\/a><\/li><li><a href=\"#Maintain_and_Validate_the_Configuration\"><span class=\"toc_number toc_depth_1\">12.<\/span> Maintain and Validate the Configuration<\/a><\/li><li><a href=\"#Technical_References\"><span class=\"toc_number toc_depth_1\">13.<\/span> Technical References<\/a><\/li><\/ul><\/div>\n<h2 id=\"section-1\"><span id=\"Why_WordPress_Attracts_Abusive_Traffic\">Why WordPress Attracts Abusive Traffic<\/span><\/h2>\n<p>A traffic spike is not proof of a DDoS attack. Login attempts, XML-RPC requests, product scraping and repeated cart operations can exhaust resources in different ways. Compare request volume with PHP worker usage, response latency and completed customer operations before choosing a control.<\/p>\n<p>The default <strong>\/wp-login.php<\/strong> and <strong>\/xmlrpc.php<\/strong> endpoints are easy to locate. The REST API intentionally exposes public data while permissions govern private operations. Cart fragments, Store API requests and plugin AJAX actions can also trigger expensive work. Identify the actual transport and handler; these are not interchangeable endpoints.<\/p>\n<p>Managed WAF rules inspect known attack patterns. Custom rules match conditions on an individual request. Rate limiting maintains counters over a defined period. These controls complement application authentication and authorization; they do not replace them or guarantee that legitimate users will never be interrupted.<\/p>\n<h2 id=\"section-2\"><span id=\"The_Foundation_How_Cloudflare_Sees_WordPress_Traffic\">The Foundation: How Cloudflare Sees WordPress Traffic<\/span><\/h2>\n<h3><span id=\"What_the_Edge_Can_Evaluate\">What the Edge Can Evaluate<\/span><\/h3>\n<p>Cloudflare evaluates web requests to proxied hostnames. Requests that reach an exposed origin directly bypass this path. Available matching fields vary by product and plan: a field supported in a custom WAF rule is not necessarily available in a rate limiting expression.<\/p>\n<p>Rejecting abusive traffic at the edge can reduce origin work. Choose an action compatible with the client: a browser page can sometimes complete Managed Challenge, while an API, XML-RPC client, webhook or background AJAX request generally cannot handle a full HTML challenge page.<\/p>\n<h3><span id=\"Check_Proxying_Origin_Access_and_Critical_Flows\">Check Proxying, Origin Access and Critical Flows<\/span><\/h3>\n<p>Confirm the intended web hostnames are proxied and plan origin access separately. Restricting origin traffic to Cloudflare ranges is one layer; the shared network or default origin-pull certificate does not identify your own zone. Consider a properly configured Tunnel or origin authentication bound to your deployment, with expected hostnames and required operational access. Inventory login, public forms, checkout, REST routes, webhooks and third-party integrations before setting restrictions.<\/p>\n<p>Use the <a href=\"https:\/\/www.dchost.com\/blog\/en\/wordpress-cdn-woocommerce-caching-rules\/\">CDN caching guide for WordPress and WooCommerce<\/a> to plan cacheable content and bypasses. Cache hits can reduce PHP work, but Cloudflare\u2019s WAF still evaluates requests served from cache. Keep personalized sessions, carts, checkout and authenticated responses out of shared caching.<\/p>\n<h2 id=\"section-3\"><span id=\"WordPress_Endpoints_and_Their_Requirements\">WordPress Endpoints and Their Requirements<\/span><\/h2>\n<h3><span id=\"1_Login_Requests\">1) Login Requests<\/span><\/h3>\n<p>For <strong>\/wp-login.php<\/strong>, distinguish a request matcher from an attempt counter. A path-and-method custom rule matches every matching POST. A rate limiting rule can count those requests over time, but does not know whether each password was wrong unless you supply a reliable, supported counting signal.<\/p>\n<p>Managed Challenge can be evaluated for an interactive browser login, allowing for possible user interaction and retries. A shared office or mobile carrier IP may represent several people. Measure normal bursts and test login, password reset and required automation before selecting a threshold.<\/p>\n<h3><span id=\"2_XML-RPC_Integrations\">2) XML-RPC Integrations<\/span><\/h3>\n<p>Disable XML-RPC only after checking remote publishing, mobile clients and other integrations. It can still attract abuse, but current WordPress stops additional authentication attempts on the same XML-RPC server instance after an authentication failure; this limits the historical multicall password amplification technique. Required machine clients need authentication, appropriate source restrictions and measured limits, without browser challenges.<\/p>\n<h3><span id=\"3_REST_API_and_Store_API\">3) REST API and Store API<\/span><\/h3>\n<p>WordPress REST requests can use <strong>\/wp-json\/<\/strong> or the <strong>rest_route<\/strong> query form. Discover the actual API root and any subdirectory installation. WooCommerce Store API routes serve customer-facing cart and checkout operations; separate <strong>wc-ajax<\/strong> and <strong>admin-ajax<\/strong> requests may also be present. Public GET requests can be abused, but write methods alone do not indicate an attack.<\/p>\n<h3><span id=\"4_Public_AJAX_Handlers\">4) Public AJAX Handlers<\/span><\/h3>\n<p><strong>\/wp-admin\/admin-ajax.php<\/strong> can serve logged-out visitors through <code>wp_ajax_nopriv_*<\/code> hooks. The <code>action<\/code> value may arrive in the POST body, not the query string. Inspect actual requests and plugin handlers before narrowing a limit. Cloudflare query argument fields do not inspect POST form data; <code>http.request.body.form<\/code> requires Enterprise and has parsing and body-size limits. Field access in rate limiting also depends on the relevant plan and Advanced Rate Limiting capabilities.<\/p>\n<h2 id=\"section-4\"><span id=\"Cloudflare_WAF_Rules_for_WordPress\">Cloudflare WAF Rules for WordPress<\/span><\/h2>\n<p>The examples below assume WordPress is installed at the hostname root. Adapt the host and base path, inspect rewrites and URL normalization, and test every accepted endpoint representation. These are independent options: enabling every example together can change which later rules run.<\/p>\n<h3><span id=\"Login_Matching_vs_Counting\">Login: Matching vs Counting<\/span><\/h3>\n<p>Decide whether you need a challenge on every login POST or only after a request-rate threshold. For most tuning exercises, start from measured traffic rather than a blanket challenge.<\/p>\n<p>Optional custom-rule expression for every POST to the default login endpoint:<\/p>\n<pre class=\"language-bash line-numbers\"><code class=\"language-bash\">(http.request.uri.path eq &quot;\/wp-login.php&quot; and http.request.method eq &quot;POST&quot;)<\/code><\/pre>\n<p>Managed Challenge on this expression applies to every matching login POST, subject to challenge clearance behavior; it does not count retries or failed passwords. Use the rate limiting example below if a threshold is intended. Do not add a global verified-bot or office-IP bypass. Custom rules run before rate limiting and managed rules; a terminating action can prevent later evaluation, so do not assume their counters see all attempts.<\/p>\n<h3><span id=\"Block_Unused_XML-RPC\">Block Unused XML-RPC<\/span><\/h3>\n<p>Optional custom-rule expression, only after confirming XML-RPC is unused:<\/p>\n<pre class=\"language-bash line-numbers\"><code class=\"language-bash\">(http.request.uri.path eq &quot;\/xmlrpc.php&quot;)<\/code><\/pre>\n<p>Action: Block. If an integration requires XML-RPC, do not activate an unconditional block or browser challenge. Where reliable provider IP ranges exist, limit an exception to this endpoint and the specific blocking condition while retaining application authentication. User-agent strings and entire ASNs are not sufficient proof of an authorized integration.<\/p>\n<h3><span id=\"Restrict_Staff_Administration_Carefully\">Restrict Staff Administration Carefully<\/span><\/h3>\n<p>A network restriction is suitable only for staff-only administration with a tested recovery path. The example excludes two public handlers. Other public plugin handlers, alternate paths and subdirectory installs require additional review. It deliberately leaves the login endpoint outside this rule because sites can use it for customer or subscriber access.<\/p>\n<pre class=\"language-bash line-numbers\"><code class=\"language-bash\">(http.request.uri.path eq &quot;\/wp-admin&quot; or starts_with(http.request.uri.path, &quot;\/wp-admin\/&quot;))\nand not http.request.uri.path in {&quot;\/wp-admin\/admin-ajax.php&quot; &quot;\/wp-admin\/admin-post.php&quot;}\nand not ip.src in {203.0.113.10 2001:db8::10}<\/code><\/pre>\n<p>Action: Block only after replacing both documentation addresses with your real static IPv4\/IPv6 addresses and testing access from those networks. The addresses above are examples, not usable office addresses. This rule must not block the known public AJAX and form handlers. Inventory additional required handlers before enabling it. Restrict <code>\/wp-login.php<\/code> separately only if it is exclusively for staff. An Access application also needs correctly scoped public-handler exclusions and tested service access.<\/p>\n<h3><span id=\"Target_Specific_REST_Routes\">Target Specific REST Routes<\/span><\/h3>\n<p>Select the exact abused route and preserve its authentication and authorization checks. Cover pretty-permalink and query-based REST access, rewrites and the actual installation path. Country or ASN alone does not establish abuse. Browser challenges are unsuitable for API consumers, webhooks and background requests expecting JSON.<\/p>\n<h3><span id=\"Scope_Verified-Bot_Exceptions\">Scope Verified-Bot Exceptions<\/span><\/h3>\n<p>Use Cloudflare\u2019s <a href=\"https:\/\/developers.cloudflare.com\/bots\/concepts\/bot\/verified-bots\/\" rel=\"nofollow noopener\" target=\"_blank\">verified bot signal<\/a> when deciding access to appropriate public read routes. A verified identity does not grant unrestricted permission to log in, write through an API or bypass all security checks. Keep exemptions limited to the intended endpoint and rule; a user-agent claiming \u201cGooglebot\u201d is not verification.<\/p>\n<h2 id=\"section-5\"><span id=\"Rate_Limiting_for_WordPress_and_WooCommerce\">Rate Limiting for WordPress and WooCommerce<\/span><\/h2>\n<p>Rate limits should reflect each endpoint\u2019s normal volume and cost. A sale, a shared IP or plugin retries can create legitimate bursts. A block still rejects real operations if its threshold is wrong; replacing it with an HTML challenge does not solve API compatibility.<\/p>\n<h3><span id=\"Plan_Limits_and_Counter_Scope\">Plan Limits and Counter Scope<\/span><\/h3>\n<p>The method-based examples below require <strong>Business or a compatible Enterprise entitlement<\/strong>. Current standard limits are one rate rule on Free, two on Pro and five on Business. Free supports Path\/Verified Bot matching and a 10-second counting period; Pro adds URI\/host\/query fields but not Method; Business adds Method and custom counting expressions. Check current limits and action options in your account.<\/p>\n<p>Counters are scoped by data center, with sharing among data centers in the same geographical location; they are not one global per-IP counter. Updates can lag, so a rule is not a precise cap on requests reaching the origin.<\/p>\n<p>These are dashboard-style settings, not API request payloads. The dashboard adds cf.colo.id to the characteristics automatically; API configurations must include it explicitly, and it must not be used as an expression field.<\/p>\n<h3><span id=\"Login_Rate_Limit\">Login Rate Limit<\/span><\/h3>\n<p>Illustrative Business-compatible rate rule; adjust the threshold after measuring traffic:<\/p>\n<pre class=\"language-bash line-numbers\"><code class=\"language-bash\">Expression: (http.request.uri.path eq &quot;\/wp-login.php&quot; and http.request.method eq &quot;POST&quot;)\nCounting: same expression; IP characteristic\nThreshold: 10 requests \/ 60 seconds\nAction: Managed Challenge\nMitigation timeout: 0 (challenge request throttling)<\/code><\/pre>\n<p>This counts login POST requests, including successful submissions, rather than failed passwords. Free\/Pro\/Business challenge actions use request throttling with mitigation timeout zero; a successful challenge resets the counter and another threshold crossing can challenge again. This is not an automatic Challenge-to-Block ladder. Any office exception must be limited to this rule and endpoint. Avoid assuming a response code of 401\/403 means a failed WordPress password without verifying actual application behavior.<\/p>\n<p>By default, the counting expression equals the matching expression. A custom counting expression does not inherit that filter: repeat the required endpoint and method conditions explicitly. Response-field counting happens after the response is sent.<\/p>\n<h3><span id=\"Rate_Limiting_Required_XML-RPC\">Rate Limiting Required XML-RPC<\/span><\/h3>\n<pre class=\"language-bash line-numbers\"><code class=\"language-bash\">Expression: (http.request.uri.path eq &quot;\/xmlrpc.php&quot;)\nCounting: same expression; IP characteristic\nThreshold: 5 requests \/ 60 seconds\nAction: Block\nMitigation timeout: 10 seconds<\/code><\/pre>\n<p>The 5-per-minute threshold and 10-second block are illustrative and may interrupt valid integrations. A path-only 60-second rule fits Pro or higher, subject to current account options; it is not a Free 60-second recipe. This counts requests, not the XML-RPC methods or password attempts inside each request. Keep required integrations authenticated and test their legitimate bursts. A timed Block continues for its mitigation period even if the rate drops; it is not Enterprise-style Block throttling with timeout zero.<\/p>\n<h3><span id=\"REST_API_and_WooCommerce\">REST API and WooCommerce<\/span><\/h3>\n<p>Target a demonstrated abuse pattern. The following Business-compatible example covers only POST to the canonical Store API add-item path. It is a candidate for a controlled test, not a recommendation to throttle every shop or every REST write. It excludes other routes and cannot distinguish legitimate buyers sharing an IP.<\/p>\n<pre class=\"language-bash line-numbers\"><code class=\"language-bash\">Expression: (http.request.uri.path eq &quot;\/wp-json\/wc\/store\/v1\/cart\/add-item&quot; and http.request.method eq &quot;POST&quot;)\nCounting: same expression; IP characteristic\nThreshold: 30 requests \/ 60 seconds\nAction: Block\nMitigation timeout: 10 seconds<\/code><\/pre>\n<p>Before enabling this rule, inventory and cover equivalent query-based <code>rest_route<\/code> access, installation prefixes and rewritten paths in appropriate additional expressions or origin\/application controls. A path-only rule is not complete route protection. The 30-per-minute threshold and 10-second block need measured justification; test the client\u2019s 429 handling and checkout recovery. Do not return Managed Challenge to this JSON endpoint.<\/p>\n<h3><span id=\"Action-Specific_AJAX_Limits\">Action-Specific AJAX Limits<\/span><\/h3>\n<p>Do not start with a broad challenge on all AJAX POST requests. Determine which handler is expensive, whether it is public, and how its action value is submitted. If your plan cannot match the required POST body field, implement an action-aware limit in the application or a supported origin layer. Query-only filtering misses body actions.<\/p>\n<pre class=\"language-bash line-numbers\"><code class=\"language-bash\">AJAX review worksheet (not an executable Cloudflare rule)\nIdentify: actual base path and plugin handler\nInspect: action in query, form body or another transport\nMeasure: normal requests per client and shared-IP bursts\nSelect: supported counter, justified threshold, API-compatible response\nTest: public forms, cart, checkout, retries and rollback<\/code><\/pre>\n<p>The review worksheet above is intentionally not a deployable rule. A 120-per-minute blanket threshold cannot establish safety for unknown plugins. Keep checkout, cart refreshes and public forms in the test matrix; correlate the selected handler with origin cost before deciding on a count and response.<\/p>\n<h3><span id=\"Tuning_Actions_and_Rule_Order\">Tuning Actions and Rule Order<\/span><\/h3>\n<p>Promotions require observed capacity and traffic baselines. Change only the affected rule and retain a rollback path. Neither challenges nor short blocks are automatically harmless, and one rule does not escalate to another without explicit configuration. Check ordering and the counters actually reached by each request.<\/p>\n<h2 id=\"section-6\"><span id=\"Testing_and_Observability\">Testing and Observability<\/span><\/h2>\n<h3><span id=\"Check_Preview_and_Logging_Availability\">Check Preview and Logging Availability<\/span><\/h3>\n<p>Use the preview or Rules simulator capabilities available in your account, and inspect existing traffic before enforcement. <strong>Log for custom rules is Enterprise-only<\/strong>; a universal Log\/Simulate mode cannot be assumed. Without it, use a narrow controlled test with a known rollback. Log matching on a Skip rule records a real bypass and is not a harmless substitute for a dry run.<\/p>\n<h3><span id=\"Inspect_Security_Events\">Inspect Security Events<\/span><\/h3>\n<p>Review Security Events for matched rule IDs, actions, endpoints and timing, then compare with origin and application logs. Available event detail, retention and analytics depend on the plan. A quiet dashboard alone does not prove success: legitimate actions and origin resource use must also be measured.<\/p>\n<h3><span id=\"Review_Public_Crawler_Access\">Review Public Crawler Access<\/span><\/h3>\n<p>If a public search crawler is affected, confirm its verified identity and the specific rule involved. The <a href=\"https:\/\/developers.cloudflare.com\/bots\/concepts\/bot\/verified-bots\/\" rel=\"nofollow noopener\" target=\"_blank\">verified bots documentation<\/a> describes the signal. Exempt only the necessary public-read scope; preserve login and API write protections and respect your own crawler access policy.<\/p>\n<h3><span id=\"Correlate_Edge_and_Origin_Logs\">Correlate Edge and Origin Logs<\/span><\/h3>\n<p>Correlate timestamps and request identifiers where available. A request blocked at Cloudflare normally never reaches PHP, so an absent origin log entry is expected for that request. An origin-generated 403 and an edge-generated 403 are different events; do not infer one from the other.<\/p>\n<h3><span id=\"Choose_a_Review_Schedule\">Choose a Review Schedule<\/span><\/h3>\n<p>Review after deployment, plugin changes and traffic shifts; a weekly review during rollout and a later monthly review are example schedules. Record false positives, unprotected routes, resource use and the reason for each threshold change. Choose the cadence against your risk and traffic.<\/p>\n<h2 id=\"section-7\"><span id=\"Compatibility_and_Deployment_Pitfalls\">Compatibility and Deployment Pitfalls<\/span><\/h2>\n<h3><span id=\"Test_the_Actual_Checkout_Flow\">Test the Actual Checkout Flow<\/span><\/h3>\n<p>A hypothetical checkout failure may come from limiting a shared AJAX endpoint. Capture the store\u2019s actual request flow: it may use Store API routes, wc-ajax, admin-ajax or a plugin-specific combination. Test guest and signed-in checkout, coupons, cart updates, payment callbacks and retries in a sandbox. Use only a narrow, justified exception if a required action is blocked.<\/p>\n<h3><span id=\"Keep_Caching_and_WAF_Roles_Clear\">Keep Caching and WAF Roles Clear<\/span><\/h3>\n<p>Caching and WAF solve different problems. Cache eligible static or anonymous content, while preserving private-response bypasses; cached requests still pass through WAF evaluation. The <a href=\"https:\/\/www.dchost.com\/blog\/en\/wordpress-cdn-woocommerce-caching-rules\/\">WordPress and WooCommerce CDN caching guide<\/a> covers those policies. A cache hit reduces origin work, not the need to evaluate edge security.<\/p>\n<h3><span id=\"Do_Not_Trust_User_Agents_Alone\">Do Not Trust User Agents Alone<\/span><\/h3>\n<p>User-agent strings are client-controlled. Combine appropriate verified identity, endpoint context and measured behavior instead of treating a familiar header as authorization. Ordinary custom rules do not track arbitrary sequences such as \u201csubmitted a form and immediately retried\u201d; use supported counters or application signals for that.<\/p>\n<h3><span id=\"Use_Country_and_ASN_Filters_Carefully\">Use Country and ASN Filters Carefully<\/span><\/h3>\n<p>Country and ASN restrictions can affect legitimate customers, traveling administrators and service providers. ASN means autonomous system number; an ASN-wide filter can cover many unrelated users and is not inherently more precise than country filtering. Apply either only with a documented reason, narrow scope and tested access recovery.<\/p>\n<h3><span id=\"Check_Bot_Product_Capabilities\">Check Bot Product Capabilities<\/span><\/h3>\n<p>Bot Fight Mode on Free and Super Bot Fight Mode on Pro\/Business have different controls. WAF Skip can target the Super Bot Fight Mode phase; it cannot skip Free Bot Fight Mode. Do not assume an \u201callow\u201d rule fixes every bot-product false positive. Review <a href=\"https:\/\/developers.cloudflare.com\/bots\/get-started\/\" rel=\"nofollow noopener\" target=\"_blank\">Cloudflare bot product setup<\/a>, available settings and WordPress compatibility, then test required clients before enabling broader protection.<\/p>\n<h3><span id=\"Retire_Obsolete_Threat-Score_Rules\">Retire Obsolete Threat-Score Rules<\/span><\/h3>\n<p>The current <strong>cf.threat_score<\/strong> field always returns zero and must not be used as a working risk signal. Other scores have their own product and plan requirements. Select documented, available signals and verify their meaning rather than copying older threat-score recipes.<\/p>\n<h2 id=\"section-8\"><span id=\"Deployment_Checklist\">Deployment Checklist<\/span><\/h2>\n<h3><span id=\"1_Check_Available_Managed_Rules\">1) Check Available Managed Rules<\/span><\/h3>\n<p>Cloudflare Free Managed Ruleset is available on all plans; the Cloudflare Managed Ruleset and OWASP Core Ruleset require Pro or higher. Review the <a href=\"https:\/\/developers.cloudflare.com\/waf\/managed-rules\/\" rel=\"nofollow noopener\" target=\"_blank\">managed rules overview<\/a> and available account controls. Managed rules reduce some known attack patterns; they neither repair vulnerable plugins nor cover every OWASP risk. Document any managed-rule exception and place it before the ruleset execution it is intended to skip.<\/p>\n<h3><span id=\"2_Select_Custom_Controls\">2) Select Custom Controls<\/span><\/h3>\n<p>Choose the controls your site needs; these options are not a mandatory three-rule bundle. Current custom-rule allowances are Free 5, Pro 20 and Business 100, with Enterprise entitlements checked separately.<\/p>\n<p>Login: prefer a measured rate rule when the goal is counting requests. Use a custom Managed Challenge on every login POST only with an explicit browser-flow requirement and an understanding that it can terminate processing before later phases.<\/p>\n<p>XML-RPC: block only when unused. Otherwise retain required integrations with authentication and an appropriately scoped rate or source restriction; do not use browser challenges.<\/p>\n<p>Administration: restrict staff-only paths with a tested network or identity policy. Preserve public admin-ajax\/admin-post handlers and any additional plugin endpoints. Restrict login separately only when the site does not use that endpoint for public accounts.<\/p>\n<h3><span id=\"3_Select_Endpoint-Specific_Rate_Limits\">3) Select Endpoint-Specific Rate Limits<\/span><\/h3>\n<p>Allocate the rate rules your plan supports to measured risks. The following numbers summarize the illustrative examples; they do not constitute universal safe limits:<\/p>\n<p>Login POST: 10 requests per 60 seconds per IP, Managed Challenge, on Business or compatible Enterprise. It counts requests, not failed credentials, and uses the plan\u2019s challenge-throttling semantics.<\/p>\n<p>Required XML-RPC: 5 requests per 60 seconds per IP, Block for 10 seconds, as a Pro-or-higher path-only example. Validate integration bursts and action options before use.<\/p>\n<p>Selected Store API add-item POST: 30 requests per 60 seconds per IP, Block for 10 seconds, as a Business-compatible canonical-path example. Cover alternate routing and test 429 recovery before enabling; no blanket REST write challenge.<\/p>\n<p>AJAX: choose a verified handler and transport first. There is no generic 120-per-minute challenge recommendation. If the required body field is unavailable at the edge, enforce the selected action\u2019s limit in a supported application or origin layer.<\/p>\n<h3><span id=\"4_Test_Application_Flows\">4) Test Application Flows<\/span><\/h3>\n<p>Use an authorized test environment and sandbox payment mode. Exercise guest and staff login, password reset, cart\/checkout, public forms, API clients and payment callbacks. Test allowed and disallowed staff networks, shared-IP bursts, alternate REST forms, installation prefixes and rewritten paths. Record expected matches and actual rule IDs; verify rollback without sending real payments or customer messages.<\/p>\n<h3><span id=\"5_Observe_and_Adjust\">5) Observe and Adjust<\/span><\/h3>\n<p>Investigate missing events before changing thresholds: the route may differ, an earlier action may terminate processing, or a bypass may skip the rule. Check source restrictions and analytics availability. For false positives, identify the affected condition and client flow, then narrow or disable that rule; do not automatically switch APIs from Block to Challenge.<\/p>\n<h2 id=\"section-9\"><span id=\"Application_and_Integration_Controls\">Application and Integration Controls<\/span><\/h2>\n<h3><span id=\"Preserve_Required_Services\">Preserve Required Services<\/span><\/h3>\n<p>Payment, inventory and monitoring services may not be verified bots. Preserve application authentication or signed callbacks. If a WAF exception is necessary, scope it to the relevant endpoint, method and rule using reliable provider restrictions where available. Modify the offending rule when practical; a phase-wide Skip can bypass every rate rule, so it is broader than a single-rule exception. Avoid global IP Allow and user-agent-only trust.<\/p>\n<h3><span id=\"Keep_WordPress_Updated\">Keep WordPress Updated<\/span><\/h3>\n<p>Keep WordPress, plugins and themes supported and updated; remove unused components and require appropriate authentication and privileges. Hiding a login link is not access control. Check that application security and edge controls do not create incompatible authentication, rate or challenge behavior.<\/p>\n<h3><span id=\"Validate_Turnstile_on_the_Server\">Validate Turnstile on the Server<\/span><\/h3>\n<p>Turnstile can add verification to a browser form when integrated correctly. The widget alone is insufficient: the backend must call Siteverify and reject invalid results before processing the action. Tokens expire after five minutes and are single-use. Test hostname\/action binding and error handling as appropriate; Turnstile is not a replacement for authentication or a general fix for machine-client challenges.<\/p>\n<h3><span id=\"Document_Expected_Behavior_and_Recovery\">Document Expected Behavior and Recovery<\/span><\/h3>\n<p>Give editors and support staff a way to report the affected URL, time and request identifier without sharing credentials. Document expected login verification, recovery access and the rollback owner. Treat a new checkout or integration failure as something to investigate, not proof that a challenge is working.<\/p>\n<h2 id=\"section-10\"><span id=\"Hypothetical_Store_Tuning_Scenario\">Hypothetical Store Tuning Scenario<\/span><\/h2>\n<p>Consider a hypothetical store where PHP workers spike while ordinary visitor volume remains steady. Logs show repeated product lookups and cart operations. This suggests endpoints to investigate; it does not establish the cause until requests are correlated with resource use and normal customer behavior.<\/p>\n<p>In that scenario, separate public reads from cart writes and identify the exact transports. Evaluate narrowly scoped limits with client-compatible responses, covering alternate route forms and shared-IP bursts. Compare origin load, latency and completed sandbox orders before and after the controlled change. No customer result, one-day improvement or interruption-free checkout is claimed here.<\/p>\n<h2 id=\"section-11\"><span id=\"Measure_Security_and_Performance_Together\">Measure Security and Performance Together<\/span><\/h2>\n<p>A useful result is measured reduction in abusive origin work while required operations continue to succeed. Track resource use, latency, blocked legitimate requests and completed orders over comparable periods. WAF configuration alone cannot promise lower hosting bills, zero spikes or smooth checkout during every promotion.<\/p>\n<p>Pair that evaluation with the <a href=\"https:\/\/www.dchost.com\/blog\/en\/wordpress-cdn-woocommerce-caching-rules\/\">WordPress and WooCommerce CDN caching guide<\/a>. Keep private responses out of shared caches and remember that edge security still evaluates cache hits. Attribute performance changes to measured behavior, including cache misses and revalidation.<\/p>\n<h2 id=\"section-12\"><span id=\"Maintain_and_Validate_the_Configuration\">Maintain and Validate the Configuration<\/span><\/h2>\n<p>Inventory endpoints first, confirm plan capabilities, and choose actions compatible with each client. Protect login, required XML-RPC and selected REST\/AJAX operations without blanket exceptions. Check custom-rule \u2192 rate-limiting \u2192 managed-rule ordering, test real application flows in a safe environment and retain a documented rollback.<\/p>\n<p>Maintain the configuration as routes, integrations and traffic change. Use the official references below alongside your own event and application evidence. A correct expression is only one part of a deployment: accepted syntax, plan entitlement, routing coverage and business-flow validation must all be checked in the target account.<\/p>\n<h2><span id=\"Technical_References\">Technical References<\/span><\/h2>\n<ul>\n<li><a href=\"https:\/\/developers.cloudflare.com\/waf\/managed-rules\/\" rel=\"nofollow noopener\" target=\"_blank\">Cloudflare managed WAF rules<\/a><\/li>\n<li><a href=\"https:\/\/developers.cloudflare.com\/waf\/custom-rules\/\" rel=\"nofollow noopener\" target=\"_blank\">Cloudflare custom rules<\/a><\/li>\n<li><a href=\"https:\/\/developers.cloudflare.com\/waf\/rate-limiting-rules\/\" rel=\"nofollow noopener\" target=\"_blank\">Rate limiting: plans and limits<\/a><\/li>\n<li><a href=\"https:\/\/developers.cloudflare.com\/waf\/rate-limiting-rules\/request-rate\/\" rel=\"nofollow noopener\" target=\"_blank\">Rate counters<\/a><\/li>\n<li><a href=\"https:\/\/developers.cloudflare.com\/waf\/rate-limiting-rules\/parameters\/\" rel=\"nofollow noopener\" target=\"_blank\">Rate limiting parameters<\/a><\/li>\n<li><a href=\"https:\/\/developers.cloudflare.com\/waf\/troubleshooting\/phase-interactions\/\" rel=\"nofollow noopener\" target=\"_blank\">Rule phase interactions<\/a><\/li>\n<li><a href=\"https:\/\/developers.cloudflare.com\/waf\/custom-rules\/skip\/options\/\" rel=\"nofollow noopener\" target=\"_blank\">Skip options<\/a><\/li>\n<li><a href=\"https:\/\/developers.cloudflare.com\/cloudflare-challenges\/challenge-types\/challenge-pages\/\" rel=\"nofollow noopener\" target=\"_blank\">Challenge compatibility<\/a><\/li>\n<li><a href=\"https:\/\/developer.wordpress.org\/reference\/hooks\/wp_ajax_nopriv_action\/\" rel=\"nofollow noopener\" target=\"_blank\">WordPress public AJAX handlers<\/a><\/li>\n<li><a href=\"https:\/\/developer.wordpress.org\/reference\/hooks\/admin_post_nopriv_action\/\" rel=\"nofollow noopener\" target=\"_blank\">WordPress public form handlers<\/a><\/li>\n<li><a href=\"https:\/\/developer.woocommerce.com\/docs\/apis\/store-api\/\" rel=\"nofollow noopener\" target=\"_blank\">WooCommerce Store API<\/a><\/li>\n<li><a href=\"https:\/\/developers.cloudflare.com\/ruleset-engine\/rules-language\/fields\/reference\/http.request.body.form\/\" rel=\"nofollow noopener\" target=\"_blank\">Cloudflare form-body field<\/a><\/li>\n<li><a href=\"https:\/\/developer.wordpress.org\/rest-api\/using-the-rest-api\/discovery\/\" rel=\"nofollow noopener\" target=\"_blank\">WordPress REST discovery<\/a><\/li>\n<li><a href=\"https:\/\/developers.cloudflare.com\/turnstile\/get-started\/server-side-validation\/\" rel=\"nofollow noopener\" target=\"_blank\">Turnstile server verification<\/a><\/li>\n<\/ul>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Plan Cloudflare WAF and rate limiting around actual WordPress endpoints. Check plan limits, public handlers, API compatibility, counters and checkout flows.<\/p>\n","protected":false},"author":1,"featured_media":12910,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[184],"tags":[],"class_list":["post-1367","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/www.dchost.com\/blog\/en\/wp-json\/wp\/v2\/posts\/1367","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dchost.com\/blog\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dchost.com\/blog\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dchost.com\/blog\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dchost.com\/blog\/en\/wp-json\/wp\/v2\/comments?post=1367"}],"version-history":[{"count":2,"href":"https:\/\/www.dchost.com\/blog\/en\/wp-json\/wp\/v2\/posts\/1367\/revisions"}],"predecessor-version":[{"id":12912,"href":"https:\/\/www.dchost.com\/blog\/en\/wp-json\/wp\/v2\/posts\/1367\/revisions\/12912"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dchost.com\/blog\/en\/wp-json\/wp\/v2\/media\/12910"}],"wp:attachment":[{"href":"https:\/\/www.dchost.com\/blog\/en\/wp-json\/wp\/v2\/media?parent=1367"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dchost.com\/blog\/en\/wp-json\/wp\/v2\/categories?post=1367"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dchost.com\/blog\/en\/wp-json\/wp\/v2\/tags?post=1367"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}