Support » Plugin: WooCommerce » Why print_script_block_data used on every page?

  • Resolved freimaks



    Recently I noticed that on every page the script “var wc_product_block_data = JSON.parse (decodeURIComponent (“.

    This script is output by the function print_script_block_data from woocommerce\packages\woocommerce-blocks\src\Assets.php.

    Why is this script needed?

    The problem is that I have a lot of categories and the script is just huge!

    Just for example, I copied the script code and saved it in a text file. File size over 500 kilobytes! Half a megabyte of incomprehensible code!)))

Viewing 5 replies - 1 through 5 (of 5 total)
  • I have this concern as well.

    In my case it’s only adding about 4kb on every page load, but it’s still mysterious and undesired just the same. Having it exist on WooCommerce-related pages is acceptable, but the problem is ALL non-WooCommerce pages seem to have this as well.

    Similarily, there’s many other WooCommerce scripts loaded on every non-WooCommerce page as well.

    This post is marked as resolved. is there a resolution?

    Yes -I am having the same issue with “var wc_product_block_data = JSON.parse (decodeURIComponent (“..

    This is being tagged by quttera as potential suspicious file… Any solution or reason why this code is necessary? Is this a result of the latest woocommerce update?

    Luke Cavanagh


    The change is new product blocks in WooCommerce 3.7.0 for the block editor.

    I’m getting it as well and would like to know some php function to remove it



    Hi, Use this in functions.php

    function wooexperts_remove_block_data(){ 
Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.