Skip to content

Can You Remove Render-Blocking JavaScript From HubSpot's COS Themes?

Can You Remove Render-Blocking JavaScript From HubSpot's COS Themes? Find out here.

David Ward
By David Ward   |  

 Jun 09, 2016

Can you remove render-block Javascript

So we were doing some SEO and page optimization last week and much to my chagrin I found 2 critical errors being reported from our PageSpeed Insights desktop report. Google told me I have 2 blocking script resources and I need to eliminate render-blocking JavaScript in above-the-fold content:

hubspot-render-blocking-js.jpg

These two JS files are not part of our theme, although I know jQuery sometimes has to be positioned in a specific place in the order of  JS and functions in order for it to work.

I searched Google and found an article on HubSpot's blog, but they just tell you how to move your own custom JavaScript code in HubSpot and don't mention their own code.

I knew I could probably figure out where this code was and move it, but since I didn't know the impact it might have on the site and didn't really want to invest 100 developer hours to find out, I decided to open a ticket with HubSpot support to find out if I could move the JS so it no longer threw an error from Google.

I'll save you the time opening your own ticket and waiting for a response. Sadly, there's nothing you can do about it. Because of the way HubSpot's COS is coded, jQuery has to load right away or the content won't even render. Then I found out that current.js is needed for CTAs:

"CTA JavaScript needs to load initially so it knows how to create the CTA when the content of the page loads rather than the CTA appearing to change and load after the the rest of the content does. In these cases having that content load first is a necessity in order for the content even above the fold to load as expected. "

Thus ends my free public service announcement for anyone else out there who might be looking for a solution to this. Sadly, there is none since CTAs are a pretty darn important part of HubSpot and Inbound Marketing!

David Ward

David Ward

A technologist, marketer, and serial entrepreneur since 1996, Dave has built solutions to nearly every problem.

Latest Articles

Maximizing SaaS Business Growth With Effective HubSpot Utilization

Maximizing SaaS Business Growth With Effective HubSpot Utilization

Unlock growth potential with HubSpot for your SaaS business. Learn how to drive traffic, convert leads, and nurture prospects effectively.

HubSpot Conversation Inbox: A Complete Guide

HubSpot Conversation Inbox: A Complete Guide

Unlock the potential of HubSpot's Conversation Inbox! Streamline communication, improve response time, and elevate team collaboration effor...

Unlocking Growth: A Guide to Leveraging Custom Objects in HubSpot

Unlocking Growth: A Guide to Leveraging Custom Objects in HubSpot

Unlock growth with HubSpot Custom Objects! Learn how to personalize marketing strategies and optimize data management for targeted insights...