0

I have embedded an external data visualization into one of my WordPress pages. When I run Google's PageSpeed Insights, I get a warning that an unused external .js is using a LOT of resources (transfer size: 842kb, potential savings: 361kb). The js is "https://public.tableau.com/vizql/v_202022006180914/javascripts/vqlmobile.js").

Is it possible to target and block this resource from initiating on my website in a attempt to reduce resource load? Thank you in advance!

Site: https://maineoutcomes.com

1 Answers1

2

This code is likely being injected by a plugin that you're using.

You can programmatically prevent that script from being loaded.

The key steps are:

  1. Find the id with which the offending script was loaded
  2. Dequeue (probably in your custom theme package) the script with that id
simmer
  • 2,639
  • 1
  • 18
  • 22
  • Thanks for the reply! It's actually not triggered by a plugin. Instead, it stems from embed code used to insert the data visualizations published on another site. The code I embedd into the body's div blocks references https://public.tableau.com/javascripts/api/viz_v1.js - which I assume calls the .js above on mobile devices. Using your referenced source above (and knowing I only have this .js call information: "https://public.tableau.com/vizql/v_202022006180914/javascripts/vqlmobile.js"), any insights on how to prevent loading the script? I'm unfortunately not a javascript Jedi... – maineoutcomes Jul 06 '20 at 17:26
  • Ah. Well, if the piece of the embed code you can control involves an `iframe`, you might want to [look into this SO answer involving CSP for iframes](https://stackoverflow.com/a/28366917/129086). – simmer Jul 09 '20 at 04:12