A newly discovered vulnerability can put your WordPress website at risk before you have time to install an official security update. Attackers can use this gap to send malicious requests and exploit weaknesses in your website’s core or server environment. Even if you regularly update your website, you may not always be able to apply a fix immediately.
This is where Cloudflare WAF (Web Application Firewall) virtual patching for WordPress can help. It adds an extra layer of protection by filtering incoming requests and blocking known exploit attempts before they reach your website. You can use virtual patches to reduce your exposure while preparing to install the permanent security update.
In this guide, you will learn what virtual patching is, how Cloudflare WAF protects WordPress websites, and how to enable and deploy virtual patches using Ultimate Security.
Table of Contents
What Is Cloudflare WAF Virtual Patching?
Virtual patching is a security method that blocks known exploit traffic before it reaches vulnerable code, without changing the code itself.
A normal patch fixes the flaw inside WordPress. A virtual patch leaves the flaw where it is and stops the requests that try to use it. The weak spot still exists until you update, but the known way to reach it is closed.
That difference matters because the two do different jobs. An update removes the flaw for good. A virtual patch only stops the exploit pattern it knows about, and only while the rule stays active. So treat a virtual patch as a temporary measure. Use it to cover the days between “a flaw went public” and “the update is live.”
Why Does Your WordPress Site Need Virtual Patching?
A WordPress website depends on several components that work together. These include WordPress core, plugins, themes, PHP, and other server-side dependencies. A security weakness in any of these components can create an entry point for attackers.
The problem is that vulnerability discovery and permanent fixes do not always happen at the same time. A security researcher may report a vulnerability, but the developer still needs time to investigate it, prepare a fix, test the update, and release it. During this period, your website may remain exposed.
Here are a few situations where virtual patching can help:
- A vulnerability is publicly disclosed: Attackers may start looking for websites that use affected software.
- An official update is not available yet: You may need temporary protection while the developer prepares a fix.
- You need time to test an update: A virtual patch can provide an additional layer of protection while you prepare and test the update.
- A server-side vulnerability affects your website: Some security issues exist in PHP or other server components rather than WordPress itself.
Virtual patching for WordPress helps reduce the risk during these situations. It gives website owners another way to block known exploit attempts while they work on permanent remediation.
How Cloudflare WAF Virtual Patching Protects WordPress
Cloudflare works as an intermediary between website visitors and your hosting server. When someone visits your website, their request passes through Cloudflare before reaching your origin server, provided the relevant DNS record is proxied through Cloudflare.
Cloudflare WAF examines incoming requests using security rules. These rules contain conditions that identify specific traffic patterns and actions that Cloudflare should take when a request matches them.
A rule can identify a request containing a known malicious payload and block it before it reaches WordPress. The basic process looks like this:
- A visitor or attacker sends a request to your website.
- Cloudflare receives the request and checks it against the configured WAF rules.
- If the request matches a security rule, Cloudflare applies the configured action, such as Block or Managed Challenge.
- Requests that are not blocked continue toward your origin server.
This allows Cloudflare to filter known malicious traffic before it reaches your WordPress application. You can use custom WAF rules to identify different types of suspicious requests. Virtual patches apply this approach to specific vulnerabilities by creating rules that target known exploit patterns.
A virtual patch may block a suspicious SQL injection payload, restrict access to a vulnerable API endpoint, or filter a documented malicious request pattern. Cloudflare explains how these rules work in its Custom Rules documentation.
How Ultimate Security Deploys Cloudflare WAF Virtual Patches
Ultimate Security includes virtual patches as part of its Cloudflare WAF tools. It lists emergency patches for specific WordPress core vulnerabilities, and each patch works as its own layer of defense. You can read the full reference in the Virtual Patches documentation.
The feature has one master switch, called Enable Virtual Patches. When it is off, no virtual patching for WordPress rules run. When it is on, you choose which individual patches to activate with their own toggles. Here is what each patch covers and what it leaves out.
Core SQL Injection (CVE-2026-60137)
The problem is in how WordPress core builds a database query from the author__not_in parameter of WP_Query. On its own, the flaw is a SQL injection, which lets an attacker slip their own commands into a database query. It affects WordPress 6.8.0 through 6.8.5, 6.9.0 through 6.9.4, and 7.0.0 through 7.0.1, and the fixes are in 6.8.6, 6.9.5 and 7.0.2.
The patch blocks common SQL injection payloads in the query string at the Cloudflare edge. There is one limit to know. Cloudflare Free plans cannot inspect request bodies, so attacks that arrive in a POST body are not covered. You still need to update WordPress to close this flaw fully.
REST Batch Endpoint RCE (CVE-2026-63030)
This flaw sits in the REST API batch endpoint and affects WordPress 6.9.0 through 6.9.4 and 7.0.0 through 7.0.1. Researchers showed that it can be chained with the SQL injection above to run code on a site without any login. They named that chain wp2shell. RCE stands for remote code execution, which means an attacker can run their own code on your site.
The patch blocks unauthenticated requests to /wp-json/batch/v1, including requests that reach it through ?rest_route=. Logged-in users are exempt. That means your admins and editors can keep working normally while the public cannot reach the endpoint.
PHP2Shell (CVE-2026-109618 and CVE-2026-109619)
These two flaws live in PHP itself, not in WordPress. PHP fixed them on October 21, 2026, and they carry a CVSS score of 9.2. In plain terms, one involves PHP running out of memory while it reads a multipart request, and the other lets leftover state from one request carry into the next on the same worker.
The patch blocks multipart POST requests that declare no Content-Length, which is one documented way to push PHP into running out of memory and corrupting a worker.
It does not cover every exploit path, because it cannot read the upload-progress field or the response. The real fix is a PHP update to 8.2.35, 8.3.36, 8.4.27 or 8.5.12.
This patch is off by default because it can block legitimate streamed uploads. Turn it on only if you cannot update PHP yet and your site does not depend on that kind of upload.
How to Enable Virtual Patching for WordPress Step by Step
You need Cloudflare connected with the Ultimate Security plugin, with Edge WAF Rules enabled. The WAF works on Cloudflare’s Free plan. You can save the virtual patch toggles before you connect Cloudflare, but nothing goes live until you deploy.

Then follow these steps.
- Open Ultimate Security and go to the WAF Rules then select Virtual Patches from Setup & Rules.
- Turn on Enable Virtual Patches.
- Switch on the patches you want. A patch marked Already patched is harmless to keep on. Leave PHP2Shell off unless you meet the conditions described above.
- Decide whether to turn on Try new block rules as a challenge first.
- Click Save Changes at the bottom of the page. Deployment only pushes saved settings.
- Select the Cloudflare zone you want to protect. A zone is the domain you manage in Cloudflare.
- Click Preview Rules to see the exact rule expressions the plugin will create. Check them before you deploy.
- Click Deploy Rules to push the rules to Cloudflare and activate them.
Deploy Rules pushes only the saved rules the plugin manages and leaves your other Cloudflare rules alone. If you ever want to undo it, Remove Plugin Rules deletes all WAF rules the plugin created in Cloudflare. That includes its other WAF rules, not just the virtual patches.
How to Avoid Locking Out Real Visitors
Any rule that blocks traffic can catch a real person by mistake. Two settings and one habit reduce that risk.
The first is Try new block rules as a challenge first. With it on, new block rules show suspicious visitors a Cloudflare challenge for the first 24 hours instead of blocking them outright. A real person can pass the challenge and reach the site. A bot cannot, so it stops there. After 24 hours, the rule switches to strict blocking on its own.

The second is Preview Rules. Read the generated expressions before you deploy so you know what each rule does.
The habit is to test after you deploy. If you turned on the PHP2Shell patch, upload an image to the media library and submit any form on your site that accepts files. Those are the actions most likely to be affected.
The REST Batch patch is the safest of the three here, because logged-in users are exempt and the public has little reason to call that endpoint.
What Virtual Patches Cannot Protect You From
Virtual patches are useful, and they have clear edges. Knowing them keeps you from relying on them too much.
- A virtual patch is a stopgap and not a permanent fix. The flaw remains in WordPress or PHP until you update.
- Cloudflare Free plans cannot inspect request bodies, so the SQL injection patch covers the query string only.
- The PHP2Shell patch does not cover every exploit path, so a PHP update is the only complete answer.
- The patches cover specific WordPress core and PHP flaws. They do not protect against vulnerabilities in plugins or themes.
- A flaw that is not on the list has no patch, so a brand new vulnerability is not covered until a patch for it exists.
No rule set blocks everything, and this one does not claim to.
Best Practices for WordPress Virtual Patching
Virtual patching for WordPress works best as part of a broader website security strategy. Follow these practices to get more value from your Cloudflare WAF protection.
- Install official security updates: Update WordPress core, plugins, and themes as soon as security fixes become available. Update PHP and other server components when their vendors release security patches.
- Review WAF rules before deployment: Use the Preview Rules option to inspect generated expressions before activating them on Cloudflare.
- Monitor the impact of new rules: Use the challenge-first option when introducing new blocking rules to reduce the risk of false positives.
- Protect your origin server: Restrict direct access to your origin server so attackers cannot easily bypass Cloudflare.
- Keep regular backups: Maintain recent website and database backups so you can recover if an attack or update causes problems.
- Monitor vulnerability reports: Keep track of security vulnerabilities for WordPress, plugins, themes, and PHP. This helps you identify affected components and apply fixes quickly.
These practices help you use virtual patches as an additional security layer while keeping your website’s software up to date.
Frequently Asked Questions
Does virtual patching replace WordPress updates?
No. A virtual patch blocks known ways to exploit a vulnerability, but the original flaw remains in your code until you install the official update. Treat virtual patching as temporary protection while you prepare and apply the update.
Does virtual patch work on Cloudflare’s Free plan?
Yes. The WAF feature works with Cloudflare’s Free plan. However, this implementation of the SQL injection patch cannot inspect request bodies on the Free plan, so it only covers supported query-string attack patterns.
What does the 24-hour challenge option do?
When Try new block rules as a challenge first is enabled, new block rules show matching visitors a Cloudflare challenge for the first 24 hours instead of blocking them immediately. Visitors who complete the challenge can continue browsing. After 24 hours, the rule automatically switches to strict blocking.
Why is the PHP2Shell patch off by default?
The PHP2Shell patch can block legitimate streamed uploads because it targets multipart POST requests that declare no Content-Length. It is off by default to reduce the risk of interrupting normal upload activity. Update PHP to a fixed version whenever possible.
How can I check which virtual patch rules will be deployed?
Use the Preview Rules option before deployment. It displays the rule expressions that Ultimate Security will create in Cloudflare, allowing you to review them before activating the rules.
What happens if I disable Enable Virtual Patches?
Disabling the master switch turns off virtual patching. The individual patch settings may remain saved, but the feature will not apply those patches while the master switch is off.
Conclusion
Cloudflare WAF virtual patching for WordPress helps reduce exposure by blocking known exploit attempts before they reach your website. With Ultimate Security, you can enable individual CVE patches, review generated rules, and deploy them directly to your connected Cloudflare zone.
However, remember that virtual patches are a temporary security measure. They do not remove vulnerabilities from your website’s code or server environment.
For better protection, combine Cloudflare WAF rules with regular software updates, vulnerability monitoring, secure server configurations, and reliable backups. This gives your WordPress website multiple layers of defense against known and emerging security threats.

Comments are moderated. Stay on topic: spam and link drops are removed.