Title: LiteSpeed changes script to type=&#8221;litespeed/javascript&#8221; breaking widget
Last modified: March 11, 2026

---

# LiteSpeed changes script to type=”litespeed/javascript” breaking widget

 *  Resolved [jackievon51](https://wordpress.org/support/users/jackievon51/)
 * (@jackievon51)
 * [2 months, 2 weeks ago](https://wordpress.org/support/topic/litespeed-changes-script-to-typelitespeed-javascript-breaking-widget/)
 * Hello,
 * I am having an issue with LiteSpeed Cache rewriting a Google Merchant Center 
   widget script, which causes the widget to stop working on my WordPress site.
    1. Original Code (before LiteSpeed optimization)
 *     ```wp-block-code
       <script id='merchantWidgetScript' src="https://www.gstatic.com/shopping/merchant/merchantwidget.js"defer></script>     <script>  merchantWidgetScript.addEventListener('load', function () {    merchantwidget.start({     position: 'LEFT_BOTTOM'   });  });</script>
       ```
   
    2. Code after LiteSpeed optimization (frontend source)
 *     ```wp-block-code
       <script id='merchantWidgetScript' src="https://www.gstatic.com/shopping/merchant/merchantwidget.js"defer></script> <script type="litespeed/javascript">merchantWidgetScript.addEventListener('load',function(){merchantwidget.start({position:'LEFT_BOTTOM'})})</script>
       ```
   
 * Because the script becomes type=”litespeed/javascript” and data-src, the Google
   Merchant widget never initializes.
    3. What I have already tried
       I have already excluded the script in LiteSpeed settings:
       LiteSpeed Cache → Page Optimization → TuningJS Excludes:[https://www.gstatic.com/shopping/merchant/merchantwidget.js](https://www.gstatic.com/shopping/merchant/merchantwidget.js)
       merchantwidgetgstatic.com/shopping/merchantJS Delayed Excludes:[https://www.gstatic.com/shopping/merchant/merchantwidget.js](https://www.gstatic.com/shopping/merchant/merchantwidget.js)
       merchantwidgetgstatic.com/shopping/merchant
 * I also purged all caches:
   Purge AllPurge All – LSCachePurge CSS/JS CacheBrowser
   hard refresh
    4. Current Optimization Settings
       JS Minify: ONJS Combine: OFFLoad JS Deferred: 
       ONDelay JS: OFF
 * Guest Mode: previously ON, now tested with OFF as well.
    5. Issue
       Even after excluding the script, LiteSpeed still rewrites the script to:
       type=”litespeed/javascript”data-src=which prevents the widget from loading.
 * Any help would be greatly appreciated.
   Thank you!

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Support [litetim](https://wordpress.org/support/users/litetim/)
 * (@litetim)
 * [2 months, 2 weeks ago](https://wordpress.org/support/topic/litespeed-changes-script-to-typelitespeed-javascript-breaking-widget/#post-18847774)
 * [@jackievon51](https://wordpress.org/support/users/jackievon51/) please send 
   a report to LiteSpeed from LSC plugin => Toolbox => Report => click on “send 
   to LiteSpeed” and share the ID generated(just the id).
   Thank you 🙂
 *  Thread Starter [jackievon51](https://wordpress.org/support/users/jackievon51/)
 * (@jackievon51)
 * [2 months, 2 weeks ago](https://wordpress.org/support/topic/litespeed-changes-script-to-typelitespeed-javascript-breaking-widget/#post-18847906)
 * [@litetim](https://wordpress.org/support/users/litetim/)
 * **WQRNYQWR**
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [2 months, 2 weeks ago](https://wordpress.org/support/topic/litespeed-changes-script-to-typelitespeed-javascript-breaking-widget/#post-18848078)
 * the issue is you have CF cache on your page , some feature from our plugin is
   not compatible with other caching system
 * you could try 1) disable the CF APO , or 2) if you only have problem with this
   particular javascript, then you can use JS exclude function to exclude it
 *  Plugin Support [litetim](https://wordpress.org/support/users/litetim/)
 * (@litetim)
 * [2 months, 2 weeks ago](https://wordpress.org/support/topic/litespeed-changes-script-to-typelitespeed-javascript-breaking-widget/#post-18848079)
 * double posting
    -  This reply was modified 2 months, 2 weeks ago by [litetim](https://wordpress.org/support/users/litetim/).
 *  Thread Starter [jackievon51](https://wordpress.org/support/users/jackievon51/)
 * (@jackievon51)
 * [2 months, 2 weeks ago](https://wordpress.org/support/topic/litespeed-changes-script-to-typelitespeed-javascript-breaking-widget/#post-18848869)
 * Thank you for your reply.
 * I have followed your suggestions and disabled both **Cloudflare APO** and the**
   Cloudflare module inside LiteSpeed Cache**, but unfortunately the issue still
   persists.
 * I have also already excluded the following script using the **JS Excludes** settings:
 *     ```wp-block-code
       https://www.gstatic.com/shopping/merchant/merchantwidget.js
       merchantwidget
       gstatic.com/shopping/merchant
       ```
   
 * However, LiteSpeed still rewrites the script on the frontend to:
 *     ```wp-block-code
       type="litespeed/javascript"
       data-src="https://www.gstatic.com/shopping/merchant/merchantwidget.js"
       ```
   
 * which prevents the Google Merchant Widget from loading.
 * Could you please help check the latest LiteSpeed report?
 * Report ID: **ZOQWMPKT**
 * Thank you very much for your assistance.
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [2 months, 2 weeks ago](https://wordpress.org/support/topic/litespeed-changes-script-to-typelitespeed-javascript-breaking-widget/#post-18848870)
 * CF page cache is still in use ,
 * ![](https://i0.wp.com/i.imgur.com/KFmnLKn.png?ssl=1)
 *  Plugin Support [litetim](https://wordpress.org/support/users/litetim/)
 * (@litetim)
 * [2 months, 2 weeks ago](https://wordpress.org/support/topic/litespeed-changes-script-to-typelitespeed-javascript-breaking-widget/#post-18849006)
 * [@jackievon51](https://wordpress.org/support/users/jackievon51/) please fix what
   my colleague wrote. I tested your setup should ignore inline JS by keyword you
   set.
   Also **type=”litespeed/javascript”** will appear only if you have **Load
   JS Deferred** set to **Delayed**.Please purge All and try purging CSS/CSS too.

Viewing 7 replies - 1 through 7 (of 7 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Flitespeed-changes-script-to-typelitespeed-javascript-breaking-widget%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/litespeed-cache/assets/icon-256x256.png?rev=2554181)
 * [LiteSpeed Cache](https://wordpress.org/plugins/litespeed-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/litespeed-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/litespeed-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/litespeed-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/litespeed-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/litespeed-cache/reviews/)

 * 7 replies
 * 3 participants
 * Last reply from: [litetim](https://wordpress.org/support/users/litetim/)
 * Last activity: [2 months, 2 weeks ago](https://wordpress.org/support/topic/litespeed-changes-script-to-typelitespeed-javascript-breaking-widget/#post-18849006)
 * Status: resolved