This PHP error in WordPress is a result of an invalid transient in WooCommerce.
This is a known issue in WooCommerce, caused by how block pattern content is cached internally. Even if you’re not using these patterns, WooCommerce still registers them, and if the content isn’t a string (e.g., due to how paths are stored in the cache), it triggers that error message.
You don’t have WooCommerce installed, you say? Doesn’t matter – many plugins leave behind their transients in the database whether they are used or not. If you ever had WooCommerce installed, you may have this transient remaining in your database.
I have had this error occur when migrating sites from production to staging and vice versa. It could pop up in these dev situations, and if you’re unaware of this issue with its simple solution, you could be chasing ghosts for a long time before you find it.
Here is the quick solution: Run the following query in MySQL:
DELETE FROM wp_options WHERE option_name = '_site_transient_woocommerce_blocks_patterns';
Alternatively (or in addition to the above), you can run the following WP CLI command:
wp transient delete woocommerce_blocks_patterns
Leave a Reply