How to Fix Render-Blocking JavaScript and CSS of Your WordPress Website

How to Fix Render-Blocking JavaScript and CSS of Your WordPress Website

After the official announcement by Google, everyone has started focusing on the page loading time of their websites. According to Google, the websites having the page loading time more than three seconds aren’t SEO-friendly.

And you already know, in this era of the web, competing with millions of websites isn’t a piece of cake. You need to make sure your website is faster than others.

If you compare the website speed with the top websites, you may be lacking because most of the sites have the page loading time below two seconds.

Now let me talk about render-blocking. Every WordPress plugin has a CSS or JavaScript file, which needs to be uploaded by the user’s browser.

It means these CSS and JavaScript files are making your website slow, which is called render-blocking of JavaScript and CSS.

In this tutorial, you’re going to learn about finding such files and fixing render-blocking.

Analyze Your Website’s Page Loading Time

You can use the speed analysis tools like Pingdom Tools, but here, you needGoogle PageSpeed Insights. Fill in your site’s URL and click on analyze.

Within a few seconds, you can see the report. It’s better to improve the page loading time for the desktop. Check the current score.

How to Fix Render-Blocking JavaScript and CSS of Your WordPress Website

According to Google, for an excellent performance, the score should be between 89-100. And I must tell you that it’s possible to achieve 100.

If you scroll down to the heading “Opportunities for you,” you can see some suggestions. From which, Eliminate render-blocking resources may be the one.

How to Fix Render-Blocking JavaScript and CSS of Your WordPress Website

Click to see the resources, and you can see all the CSS and JavaScript files. Sometimes, you may notice any cache file.

The point is you need to focus on optimizing CSS and JavaScript files.

Use Autoptimize to Minify CSS and JavaScript Files

As you may already know that Autoptimize is a plugin which helps to optimize the coding files of a WordPress website, you can use it to fix render-blocking JavaScript and CSS files.

Go to Plugins>>Add New and search for Autoptimize. Install and activate the plugin. I hope you know how to install a WordPress plugin.

Now go to Settings>>Autoptimize and you can see options for JavaScript and CSS. Check the boxes to optimize JavaScript and CSS.

How to Fix Render-Blocking JavaScript and CSS of Your WordPress Website

Click on Save Changes and Empty Cache if you have a caching plugin. Otherwise, click on the Save Changes button.

Now recheck your website score. If you get some positive results, perfect. Otherwise, you can use a caching plugin like W3 Total Cache to minify JavaScript and CSS codes.

Install and Activate W3 Total Cache

If you already use W3 Total Cache as a caching plugin for your WordPress website, you don’t need any other plugin to minify the website code.

Go to Performance>>General Settings and scroll down to the Minify settings. Check the box to enable and save changes.

How to Fix Render-Blocking JavaScript and CSS of Your WordPress Website

In most of the cases, such a minifying setting solves the problem. If you still face any challenge, you need to use the specific plugin which is developed to fix render-blocking JavaScript and CSS.

For my website, you can see the current score; it’s 100 for the desktop version.

How to Fix Render-Blocking JavaScript and CSS of Your WordPress Website

If you focus on the mobile version, you can manually add the scripts and CSS to W3 Total Cache’s minifying settings. For now, use auto option and check your site’s performance.

I Hope You Got an Idea to Fix Render-Blocking JavaScript and CSS

No doubt that websites’ speed plays a vital role in the SEO score. You can relate when you visit a website with a poor page loading time. Do you wait for long? I don’t think so.

There are tons of options available on the web. If your site is slow, someone else provides a better user experience than yours.

Conclusion

The main idea behind fixing render-blocking JavaScript and CSS file is to minify the code of these files. If you’re an advanced developer, you can minify JavaScript and CSS manually.

But if you use WordPress, there are many plugins to accomplish such a task.

Check out these top 3 WordPress hosting services:

A2 Hosting
£1.50 /mo
Starting price
Visit A2 Hosting
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.0
  • Features
    4.5
  • Reliability
    4.8
  • Pricing
    4.0
IONOS
£0.77 /mo
Starting price
Visit IONOS
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.0
  • Features
    4.5
  • Reliability
    4.5
  • Pricing
    4.3
Webdock
£0.80 /mo
Starting price
Visit Webdock
Rating based on expert review
  • User Friendly
    3.8
  • Support
    4.5
  • Features
    4.5
  • Reliability
    4.3
  • Pricing
    4.3

How to Disable the wp-cron.php File for Your WordPress Site Using cPanel

This how-to guide explains why you should disable the wp-cron.php file to improv
less than a minute
Bruno Mirchevski
Bruno Mirchevski
Hosting Expert

How to Optimize WordPress Database Using WP-Sweep

This how-to guide will explain about the use of WP-Sweep WordPress plugin to opt
less than a minute
Eliran Ouzan
Eliran Ouzan
Web Designer & Hosting Expert

How To Install and Configure the WP Super Cache Plugin on WordPress

This guide will help you install and configure the WP Super Cache plugin to boos
less than a minute
Max Ostryzhko
Max Ostryzhko
Senior Web Developer, HostAdvice CTO

How to Secure Your WordPress Website

Millions of websites get hacked every year and many people consider WordPres
less than a minute
Eliran Ouzan
Eliran Ouzan
Web Designer & Hosting Expert
HostAdvice.com provides professional web hosting reviews fully independent of any other entity. Our reviews are unbiased, honest, and apply the same evaluation standards to all those reviewed. While monetary compensation is received from a few of the companies listed on this site, compensation of services and products have no influence on the direction or conclusions of our reviews. Nor does the compensation influence our rankings for certain host companies. This compensation covers account purchasing costs, testing costs and royalties paid to reviewers.
Click to go to the top of the page
Go To Top