If you updated to WordPress 7.1 and suddenly received an automated email about a fatal error, or logged in to find WP Rocket paused in “recovery mode,” you’re not alone. This is a known compatibility issue between WP Rocket and WordPress 7.1, and it’s affecting sites across the web right now. Here’s exactly what’s happening and how to get your site back to normal.
What the Error Actually Says
The email or error log typically points to a problem in WP Rocket’s Cloudflare integration file, something like:
Uncaught TypeError: substr(): Argument #1 ($string) must be of type string, int given in …/wp-content/plugins/wp-rocket/inc/ThirdParty/Plugins/CDN/Cloudflare.php:562
Don’t worry, this isn’t a hacked site or a corrupted install. It’s a code-level bug triggered by a change in how WordPress 7.1 handles hook callbacks, combined with PHP 8’s strict type checking (PHP won’t silently convert an integer to a string the way older PHP versions did).
Is Your Site Broken?
Probably not. WordPress has a built-in fatal error protection feature that catches errors like this and automatically pauses the offending plugin, in this case, WP Rocket, rather than taking your whole site down. If you check your homepage, it’s very likely still loading normally. The main thing you lose in the meantime is WP Rocket’s caching and performance features.
How to Fix It
1. Check for a plugin update first. This is the easiest fix if one is available. Go to Plugins → Installed Plugins and look for an update on WP Rocket. As of this writing, WP Rocket’s developers have publicly acknowledged the bug and are actively working on a patch, but no fixed version has shipped yet, so don’t be surprised if there’s nothing to update to right now.
2. Deactivate WP Rocket temporarily. If no update is available, the safest option is to simply deactivate the plugin until the official fix ships. Your site will keep running, just without the caching boost, and you can reactivate it once WP Rocket releases a patched version.
3. Apply a manual code fix (advanced users only). If you’re comfortable editing plugin files via FTP or your host’s file manager, the bug can be resolved by casting the problematic variable to a string in Cloudflare.php around line 562. Keep in mind this edit will be overwritten the next time WP Rocket updates, so you’ll want to remove it once the official patch lands.
Don’t Forget to Exit Recovery Mode
If WordPress dropped you into recovery mode to let you access your dashboard safely, be sure to click Exit Recovery Mode after you’ve deactivated WP Rocket (or applied a fix). Recovery mode’s only job is to protect you while the broken plugin is active; once it’s handled, there’s no reason to stay in that mode.
When Will This Be Fixed?
WP Media, the company behind WP Rocket, has confirmed on their support documentation that they’re aware of the WordPress 7.1 compatibility issue and are working on a solution. Keep an eye on the WP Rocket changelog and check for plugin updates every few days. Once a patched version is released, a simple update will resolve the issue for good.
Key Takeaways
- This is a known bug, not a hack or a corrupted install.
- Your site likely still works; only WP Rocket’s caching is affected.
- Deactivating WP Rocket is the safest short-term fix if no update is available.
- Always exit recovery mode once the broken plugin is handled.
- Watch for a WP Rocket update to restore full functionality.
