Fatal error on WordPress 7.1
Heads up! This issue was fixed in the WP Rocket v3.23.2.2 release since August 20th, 2026.
Please update your plugin to resolve it.
Follow this guide if you can't see the update in your plugin list.
As of August 2026, there's an issue between WP Rocket and WordPress 7.1 version. This article contains the potential solutions as well as more details about this problem.
Solution if you have access to the backend of your site
- Make sure WP Rocket is deactivated.
- Install and activate the WP Rocket - Update Notification Recovery helper plugin.
- This admin notice will appear only if the name of the WP Rocket plugin folder was modified. In that case, please click on the
Restore folder namebutton. - If needed, click on the
Check Available Updates Nowbutton next to WP Rocket in the Plugins list page. - Update WP Rocket to 3.23.2.2 or higher.
- Once the update is complete, deactivate and delete the WP Rocket - Update Notification Recovery helper plugin.
Solution if you lost access to the backend of your site
Follow these steps if you completely lost access to the WordPress admin panel on your site:
- Manually deactivate WP Rocket by renaming the
/wp-content/plugins/wp-rocket/folder to/wp-content/plugins/wp-rocket-off/via FTP. - Enter your WordPress admin to recover access, and make sure WP Rocket appears as deactivated.
- Manually rename the WP Rocket back to
/wp-rocket/. - Update WP Rocket to 3.23.2.2 by activating the WP Rocket - Update Notification Recovery helper plugin, and following the steps of the first solution.
Related error logs
To help you identify this issue, the following are the related error log entries:
An error of type E_ERROR was caused in line 562 of the file .../wp-content/plugins/wp-rocket/inc/ThirdParty/Plugins/CDN/Cloudflare.php.
Error message: Uncaught TypeError: substr() expects parameter 1 to be string, int given in .../wp-content/plugins/wp-rocket/inc/ThirdParty/Plugins/CDN/Cloudflare.php:562
PHP Fatal error: 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
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
Also, the issue is detailed in WP Rocket's public repository: https://github.com/wp-media/wp-rocket/issues/8596.
Other manual workarounds
- Delete and re-install WP Rocket: If you will have to delete WP Rocket completely to re-install the newer versions, you can save the current WP Rocket settings by exporting them with the WP Rocket | Export WP Rocket Settings plugin as shown here (this only works before WP Rocket is deleted).
- Edit of the problematic line of code manually: Customers who are comfortable editing PHP could try changing this line to
if ( substr( (string) $key, - strlen( $method ) ) !== $method ) {. - Edit of the problematic line of code with a mu-plugin: Customers who prefer not to edit any files can apply the fix with a small drop-in helper instead: download this file (wp-rocket-cloudflare-intkey-fix.php), right-click and choose "Save As" to keep it as
wp-rocket-cloudflare-intkey-fix.php, then upload it via SFTP or the hosting File Manager into/wp-content/mu-plugins/(create themu-pluginsfolder if it does not exist).
It loads automatically with nothing to activate, clears the critical error immediately, and can simply be deleted once the permanent fix is released.
Issue status
WP Rocket developers have published a fix on version 3.23.2.2.
For further help, please contact support from the orange Ask Support button at the bottom right of this page, or email us at support@wp-rocket.me.