codehaven - php snippets - coding help
Generic filters
Exact matches only

Defer Javascript until HTML loaded – WordPress – Gtmetrix

18th July 2020


SEO category

Add this to your functions.php file and it will speed the loading of the page up. It does this by putting .js files to the back of the queue. It helped me by running YouTube plugins last as they were taking ages to load stopping the user viewing the page.
As soon as I added this it was fixed. the page loaded fast and only inserted the last bits after the page was displayed.

Was this code snippet helpful?