I am using wordpress
for my website. Now i want to improve my website speed i have checked it on google page speed test and gtmetrix there are certain errors like parsing of javascript
, compreess images
, minify html
, minify css
, etc. Then i started search to fix those erros, So, for parsing of javascript
i have found some solutions like this How To Defer Parsing Javascript in WordPress i have also placed the code in my functions.php
file as suggested on that link.
Now i am going back to googe page speed test
and gtmetrix
re-checking the parsing of javascript
is still there. I have tried lot of solutions from google but i am not able to understand that how do i check them if they are applied or not.?
Any help would be appreciated.
What's happening is your JavaScript is being imported in the head of your html document. There's a wordpress plugin you can use called “WP Defer Loading" and another called "BJ lazy load" both defer importing any JavaScript until the main content of your page loads which is usually best practice anyways.