WooCommerce Fatal Error Alert (BlockPatterns.php)
-
Some WooCommerce stores are currently experiencing fatal errors due to an issue with how WooCommerce receives block pattern data from a remote service. We’ve deployed a fix, but it may take some time to fully propagate to all sites.
How do I know if this affects my site?
If your store admin panel or store frontend are displaying
Uncaught Error: strpos(): Argument #1 ($haystack) must be of type string, null givenor you’re unable to access your store or admin area completely, you may be impacted by this issue.What action should I take?
If your store is experiencing this issue, there are several things you can do to fix it while our fix propagates to all sites (we have deployed a fix, but it will take some time to reach all sites).
- If possible, clear the
ptk_patternstransient, which can be done with WP CLI:wp transient delete ptk_patterns --skip-themes --skip-plugins - Directly delete
_transient_ptk_patternsfrom the DB (update thewp_prefix to your db prefix)DELETE FROM wp_options WHERE option_name = '_transient_ptk_patterns'; - Deactivate and reactivate WooCommerce: This can also clear the transient and resolve the error for many sites.
- If you are unable to use the previous methods, modify the
plugins/woocommerce/src/Blocks/BlockPatterns.phpfile and add this code block inside of theparse_categories()function.
You can read more about this here: https://developer.woocommerce.com/2025/05/06/woocommerce-fatal-error-immediate-action-required/
We appreciate your patience as we work to ensure all sites are updated. If you need further help, please don’t hesitate to reach out!
- If possible, clear the
The topic ‘WooCommerce Fatal Error Alert (BlockPatterns.php)’ is closed to new replies.