How to eliminate the render-blocking JS from Hubspot on my Wordpress site


#1

Is there a way to eliminate the Hubspot render-blocking Javascript file on my Wordpress site?

I am also getting some "leverage browser caching" errors from PageSpeed Insights on what appear to be Hubspot resources. How can I fix this issue?


#2

To fix the render-blocking issue go to Settings > Website > Pages. The jQuery section is at the bottom, check the select box and save.

As for the browser caching issue, they are HubSpot resources and the cache-controls max-age have set to 1, 5, and 10 minutes for the ones you are talking about. I imagine there is a reason, but eTags are also defined and they are not changing.....


#3

i have taken the steps that you recommended and i'm still getting the "Eliminate render-blocking JavaScript and CSS in above-the-fold content" error from PageSpeed Insights for this file : https://js.hsforms.net/forms/v2.js

as a note, my website is a wordpress site and i have embedded some of my hubspot forms into the site. the site was not built in Hubspot. i don't know if that makes any difference or not.

thanks for your help!


#4

Never used Wordpress, but if you are embedding HS resources presume you can control where they are located. Put the JS at the bottom just above the tag.

If Wordpress does not allow this, then try adding async attribute, this will allow the page to continue loading while it fetches the js file.