Render Blocking Js


If you analyze the speed of your site via Google PageSpeed Insights, you may get a warning which is Eliminate render-blocking JavaScript and CSS in above-the-fold content as below.

Eliminate Render Blocking Warning

This warning contains two part which are Optimize CSS Delivery and Remove render-blocking JavaScript.

Remove Render Blocking JavaScript

– This feature fixes only Remove render-blocking JavaScript warning.
– This feature does NOT fix Optimize CSS Delivery warning.

How it works

You can find lots of tutorial which are talking about adding attributes which is “defer” or “async” or loading js after page load. This is so easy way but it does not fix the problems.

The all script tags are moved to the footer.

Conditional Comments

HTML comments may be in your html as below.

In this case, first we separate them and move only the script tags to the bottom.

Exclude Js Sources

If you wanna exclude some js sources, first of all you need to be sure that the js source is not affected by any other js sources. Secondly, you need to add data-wpfc-render="false" attribute as below.