I'm newbie in HubSpot and I need to improve a site's page speed insight score. In this I came across the issue of render blocking elements as all scripts inside the site are loaded in header. I need to move them to the site footer, but seeing no way or option to do so. It seems that all CSS and script files seen in header is included from {{ standard_header_includes }} but I don't see where that code is getting added to move script files to footer. Any help is really appreciated.
You actually control the loading of the scripts where YOU are actually calling them.
So for example anywhere you use require_js or require_css you actually in that function choose if you want to load in the header, footer, load it async, deferred, etc.
By default module.js is loaded in the footer, module.css is loaded in the header. Each are minified.
The order of your require statements in the actual page determines the ordering of the HTML script and link tags.
I highly recommend checking out the optimizing your CMS Hub site for performance page as it is very thorough on the things you can do to make your site blazingly fast. The JavaScript section in particular is relevant to what you're talking about. https://developers.hubspot.com/docs/cms/guides/speed#javascript
Also I want to add, If you're inheriting your site from another developer, it's a good idea to look under website settings > pages and see if the developer set domain wide head html. If they did you'll want to review that code and make adjustments to move it to the footer appropriately.
Welcome to the HubSpot developer community @karthika.