LiteSpeed changes script to type=”litespeed/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.
- Original Code (before LiteSpeed optimization)
<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>- Code after LiteSpeed optimization (frontend source)
<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.
- What I have already tried
I have already excluded the script in LiteSpeed settings:
LiteSpeed Cache → Page Optimization → Tuning
JS Excludes:
https://www.gstatic.com/shopping/merchant/merchantwidget.js
merchantwidget
gstatic.com/shopping/merchant
JS Delayed Excludes:
https://www.gstatic.com/shopping/merchant/merchantwidget.js
merchantwidget
gstatic.com/shopping/merchant
I also purged all caches:
Purge All
Purge All – LSCache
Purge CSS/JS Cache
Browser hard refresh- Current Optimization Settings
JS Minify: ON
JS Combine: OFF
Load JS Deferred: ON
Delay JS: OFF
Guest Mode: previously ON, now tested with OFF as well.
- 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)
Viewing 7 replies - 1 through 7 (of 7 total)
You must be logged in to reply to this topic.
