How to Fix Render-Blocking JavaScript & CSS in WordPress

0

We already discussed in previous article about WordPress Speed Optimizations. But still you may have noticed that in Google Pagespeed Insights we usually get error “Eliminate render-blocking JavaScript and CSS in above-the-fold content”. In this post we are going to discuss how to fix render-blocking Javascript & CSS in WordPress.

Read : How to Leverage Browser Caching in WordPress

Steps to Fix Render-Blocking JavaScript & CSS in WordPress

In previous article of WordPress Speed Optimizations we have installed W3 Total Cache. Here we are going to use that plugin for Optimizations.

  1. Go to WordPress Dashboard -> Performance -> General Settings.
  2. Change Minify mode to manual.
  3. Go to Google Pagespeed Insights and test your URL. Keep this page open we will need it later.
  4. Go to WordPress Dashboard -> Performance -> Minify.
  5. Navigate to JS section and enable it & change embed type of Before </head> to Non-blocking using “async”.Fix Render-Blocking JavaScript & CSS in WordPress
  6. Get URL of the JS files that needs to be fixed from Google Pagespeed Insight test we did earlier.
  7. Now one by one add those files as shown in screenshot below.Fix Render-Blocking JavaScript & CSS in WordPress
  8. After adding all files click Save all settings.
  9. Similarly Enable CSS minify settings.Fix Render-Blocking JavaScript & CSS in WordPress
  10. In CSS File management follow the same process we done in JS above.Fix Render-Blocking JavaScript & CSS in WordPress
  11. After adding all files click Save all settings.
  12. Now Empty all caches and check Google PageSpeed Insights score again.

Caution : Adding some JS/CSS file may cause problem in loading or undesirable user experience. So you can check after adding each file whether it is compatible with this optimization or not.

Thank you for reading this post and keep connected to Tech Arrival to continue enjoying wonderful posts. Share your views about this post in comment section below. If you are still having any query throw it in comment section.

If you find this post helpful, don’t hesitate to share this post on your social network. It will only take a moment and also it is quite easy and helpful for others.

Speak Your Mind