Fatal error on WordPress 7.1

Heads up!  
This issue was fixed in the WP Rocket v3.23.2.2 release.

Please update your plugin to resolve it.
Follow this guide if you can't see the update in your plugin list.

As of August 19th 2026, there's an issue between WP Rocket and WordPress 7.1 version. This article contains more details about this problem.

Related error logs

The following error log entries are related to this issue:

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

The issue is detailed in WP Rocket's public repository: https://github.com/wp-media/wp-rocket/issues/8596.

Known workarounds

Here's the full list of possible workarounds that could be used in the meantime:

  • Deactivate WP Rocket manually by renaming the /wp-content/plugins/wp-rocket/ folder to  /wp-content/plugins/wp-rocket-off/ via FTP.
  • Deactivate WP Rocket using WordPress's recovery mode.
  • Rollback to a previous WordPress version, if appropriate for the setup.
  • Customers who are comfortable editing PHP could try changing this line to if ( ! is_string( $key ) ) {.
  • 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 the mu-plugins folder 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  v3.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.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us