1

I am optimizing speed of my website and fixed all issues except "Eliminate render-blocking JavaScript and CSS in above-the-fold content".I have gone throgh many solutions but not resolved till now.

enter image description here

1 Answer 1

1

In most cases this won't actually increase your speed by much but will make your site design "flash" in and look bad. If your site is fast then ignore this notice (search engines care about actual speed not "scores") and most websites do not defer the CSS because it makes the site render not as nicely and as long as you aren't loading JS from 3rd party API's it won't make much difference anyway (themes should be loading scrips from WP core or the theme so usually it's fine).

Of course if you really want to there are plugins for that or you can use custom code. Here is a good tutorial - http://matthewhorne.me/defer-async-wordpress-scripts/ - just be careful because some themes and plugins purposely add JS to the header because it's needed early on.

3
  • I'd disagree. Actually you cannot generalize the topic like that. Depending on the site structure, eliminating at least some render blocking JavaScript & CSS will actually give your users a better loading experience when they load the site for the first time. If most of your sites are giving "flash" in doing so, then you are building the site wrong. You can of course ignore some of these optimization messages from page speed, but not all of them.
    – Fayaz
    Mar 2, 2017 at 22:11
  • Yes of course it depends a lot on the theme being used and you shouldn't ignore things completely. I wasn't specific enough the "flash" I am referring to is when you defer stylesheets such as the main style.css - which means the html will load before the styles for the html in which case it won't look ideal. Theme and plugins if they are well coded the scripts that aren't needed right away should be deferred by default.
    – WPExplorer
    Mar 2, 2017 at 23:54
  • Of course it never hurts to further optimize things, but for most people there are more important things to focus on such as getting a better server, caching...etc. If you don't know what you are doing it may be best to leave this particular thing alone ;)
    – WPExplorer
    Mar 2, 2017 at 23:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.