How to fix and eliminate JavaScript and CSS render locks in WordPress

Why your site needs Schema Markup and how to add it in WordPress
How to migrate your Wix site to WordPress

The speed of a website is one of the most important factors in attracting and retaining visitors. If all other factors are equal, a faster site is much more likely to attract users. That’s because search engines take into account the speed of the site to sort the results. So if you want to leave your competitors in the dust in SEO, make the site speed a priority.

Of course, evaluate the speed of your website can be a problem. There are a number of variables that can affect your test methodology – speed connection to the internet, geographical location, etc. This is where the Google Insights PageSpeed appears. It is a free service offered by Google, which assigns a score to sites based on their download speeds. Ideally, you want to mark for you as much as possible in PageSpeed. If you’ve used the online tool, you can be counted with the infamous Eliminate JavaScript and rendering blocking CSS, the suggested content above the fold for your site.

1. What eliminate the render-blocking JavaScript and CSS above the fold content items:

To understand this suggestion, we need to look at the ranking of Google’s criteria for sites on page Speed Insights. Ten rules of speed set by Google , and failure in one of them can result in a reduction of points.

The Render-blocking JS and CSS content is one of those rules. Typically, JS and CSS scripts force browsers to delay the reading of HTML pages. Of course, this is not a problem. In fact, it’s exactly what you want; in any way if you want content that has no style.

Render-blocking JS and CSS, include those scripts that introduce latency in content but are not used as content. ATF content (above-the-fold) refers to the part of the Web page that is visible when the page is loaded; Any part of the page that you have to scroll down to achieve, not ATF. So with that suggestion, Google is reporting that there JS and CSS scripts on this web page that are slowing down unnecessarily, as part of the page they affect even still observable to the user.

In this tutorial WordPress , we will use the Google PageSpeed Insights to identify scripts of rendering blocks. Then we show how to fix this problem for your WordPress site using three different methods. In addition to this guide, you should also look for other ways to speed up your WordPress site to have a great user experience.

2. What you will need:

Before starting this tutorial, you will have access to the WordPress admin area.

Delete the JavaScript and CSS rendering lock the contents of error above the fold.

The JS and CSS are crucial for any modern site, not just to function at a higher level, but also to make searches over. However, there is something strange in performance. While there are some steps you can take to make your site faster, to defer consideration of JavaScript, this can sometimes not be enough. We are, of course, talking about the JavaScript and rendering blocking CSS. To take care of this issue, we must first ensure that it still exists. After confirming the terms rendering blocking scripts on our site, we can move on to possible fixes.

Step 1 – Using Google PageSpeed ​​Insights to find JS and CSS rendering lock

The first step to correct the rendering block tests the speed of your website using Google PageSpeed Insights . Just visit the page, and in the entry field, paste the URL of your website. Click Analyze to get a report of your website. Most brand sites 50-70; this should serve as a reference for your score. Besides the score, Google also provides suggestions to improve the performance of your site.

eliminated from the render-lock-javascript-wordpress

To show how to fix the rendering blocking error, we will use a real site. In the screenshot above, you can see that there are currently some JS and CSS blocking capabilities.

After testing your site with the PageSpeed Insights tool, you can also find the suggestion: delete the JavaScript and CSS rendering blocking the content above , then you should continue reading this tutorial WordPress. Keep this tab open in your Web browser, because you may need to correct this issue.

You must have one important thing in mind – your goal here should not be to score 100 points in PageSpeed ​​Insights. Instead, you should try to improve to get a good score, without sacrificing user experience. If there are scripts for their core WordPress site, you should not remove them just to get a score slightly higher in PageSpeed ​​Insights. The rules that Google ranks their websites are merely guidelines, and should be taken as such.

Step 2 – Fixing the rendering block in JavaScript and CSS

Option 1 – Using the W3 Total Cache

Now that you are aware of rendering lock code on your site, you have a few options on how to fix it. We recommend to download a plugin that facilitates your life to take care of this problem. One of our favorites is the Install and activate it. Once you set it, follow these steps:

  1. Go to Performance -> General Settings . Find the header Minify on the page.
  2. You will see some options below this title. The first is entitled Minify; Check the box Turn in front of her.
  3. In option Minify mode , Manual choice and then click Save All button settings.minify
  4. At this point, you should seek all JS and CSS scripts that cause the rendering block. You will find these scripts using Google PageSpeed ​​Insights. If you keep an open tab PageSpeed ​​as suggested in Step 1, you will find the way to correct the text by clicking in the rendering locking hint. This will list all scripts and stylesheets that cause the rendering block.
  5. Go back to WordPress. Navigate to Performance -> Minify. You need to minimize the JS and CSS files separately.
  6. First, let’s take care of the JS. On the page, find the JS title, you will see the Operations section. There, choose not block using DEFER as the type of incorporation to the <head> tag before.configurations-cache-Minicraft hostinger
  7. Then below the JS file management sub-title, select your active theme and click the Add Script button. Now simply copy the URLs of JS scripts PageSpeed ​​tab and paste them here one by one. This completes the correction for JS files.add resources
  8. Moving on to CSS. Scroll further down on the same page to find the CSS section. Under the CSS file management subtitle, choose your active theme and click Add a style sheet. Similar to the JS script, copy and paste the CSS PageSpeed ​​Insights for this section.css file management
  9. Finally, click the Save Settings button and clear the cache.

You should now go back to the Google PageSpeed ​​Insights to see if the rendering block was corrected. From the screen below, you can see the settings of the total cache fixed W3 settings, JavaScript and CSS rendering lock above and the error content to the test site.

rendering eliminateIf you want to have more control over the content, check out how to do the optimization . This plugin was designed specifically for ATF content and works with other popular plugins such as W3 Total Cache and Autoptimize.

Option 2 – Using Autoptimize

A method comparatively easy to solve the rendering problem is blocking through another plugin called install the plugin , which should not take long. After finishing the installation, go to the area Settings -> WordPress Autoptimize . Here, just check the boxes titled Optimizing JavaScript code and optimize CSS code . Press Save Changes button and empty the cache.

automation settings

In most cases this is enough to correct the renderings (depending on your theme and the plugin activation).

To find out if you are not one of those people, turn your site via the PageSpeed ​​Insights.

google pagespeed after automationAs you can see from the screenshot above, the Autoptimize will make a JS resource block and a CSS resource block.

If further deepen optimization, return to Settings -> Autoptimize . Click the Show advanced settings. From there, check the options. Then adds JS online and add CSS online. Finish by clicking Save Changes and empty the cache . To see if it worked, revisit PageSpeed Insights.

Option 3 – Using the Speed ​​Booster Pack

Another popular plugin that you might find useful for correcting the rendering lock for your WordPress site is the activate the plugin . You will find your options in the section Settings -> Acceleration Pack in the WordPress admin area.

For JS scripts, you must enable Move scripts to the footer and postpone the analysis of JavaScript files.

Configuraçõs of thrusting pagespeed

For the CSS rendering block, go to the “Need more speed?” Here you will find additional settings relating to: CSS optimization; Minify CSS; move CSS styles in line for the footer and CSS load asynchronously.

pagespeed boosterYou can try these optimizations to find a middle ground, and allows everyone to upload your site faster, but may also have unwanted Flash content nondestructive artifacts (FOUC). This happens when the browser loads the web page without waiting for the style sheet of the load, causing a momentary flash of any page style. To ensure that the rendering block is no longer a problem, check the Google PageSpeed ​​Insights again.


The rendering block can be detrimental to the speed and performance of your WordPress site. In this tutorial on WordPress, we learn to correct and eliminate the blockage in rendering JavaScript and CSS content. Although your site still contains some scripts and stylesheets needed for rendering block, we hope this tutorial has helped to address at least part of the problem.

If any of the above fixes broke the functionality of your site in some way, be sure to follow the rendering lock code. Remember, from now on your site’s speed will only get better. You should not compromise the basic functionality. So, if there is still some rendering hanging lock code on your site, do not worry about it.

Found this content useful? We have a lot more tutorials for you, click here to read . Of course, all about cheap web hosting and more details about our plans, they are available on our website.