{"id":3286054,"date":"2024-03-19T09:10:21","date_gmt":"2024-03-19T08:10:21","guid":{"rendered":"https:\/\/wp-rocket.me\/?post_type=core_web_vitals_hub&#038;p=3286054"},"modified":"2024-09-12T15:29:47","modified_gmt":"2024-09-12T13:29:47","slug":"eliminate-render-blocking-javascript-css","status":"publish","type":"core_web_vitals_hub","link":"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/eliminate-render-blocking-javascript-css\/","title":{"rendered":"How to Eliminate Render-Blocking Resources on WordPress"},"content":{"rendered":"<p>When speed testing your WordPress site, it\u2019s common to see the recommendation that you should eliminate render-blocking resources on your website. This can sound very technical and intimidating at first, especially if you don\u2019t know what this term even means.<\/p><p>In a nutshell, it describes website files that slow down the loading process, which can significantly impact your website\u2019s performance. That\u2019s bad news as it negatively affects how visitors perceive your site and also ranking factors like <a href=\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/\">Google\u2019s Core Web Vitals<\/a>.<\/p><p>To prevent this from happening, in this post, we will give you detailed instructions on how to eliminate render-blocking resources in WordPress. You will learn what exactly they are and why it\u2019s important to deal with them, how to find which of your files pose a problem, as well as how to take care of them.<\/p><h2 class=\"wp-block-heading\">What are Render-Blocking Resources?<\/h2><p>First things first, what exactly do we mean when we say render-blocking resources? As mentioned above, they are website files that prevent pages on your website from loading quickly. To understand that, you need to know how the loading process works.<\/p><p>When a visitor accesses one of your web pages, their browser starts processing the page\u2019s HTML code from the top. Here, it usually finds numerous calls for other files, such as CSS style sheets and JavaScript scripts. These add styling like colors and element sizes as well as interactivity to web pages.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"875\" height=\"107\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/stylesheet-calls-in-document-head.jpg\" alt=\"\" class=\"wp-image-6673437\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/stylesheet-calls-in-document-head.jpg 875w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/stylesheet-calls-in-document-head-310x38.jpg 310w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/stylesheet-calls-in-document-head-768x94.jpg 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/stylesheet-calls-in-document-head-190x23.jpg 190w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/stylesheet-calls-in-document-head-736x90.jpg 736w\" sizes=\"(max-width: 875px) 100vw, 875px\" \/><\/figure><p>The thing is, when the browser encounters them, it must also download and process these files. During that time, it is busy and can\u2019t use its processing power to continue rendering the page. This pauses the loading process and, as a consequence, your page takes longer for website visitors to show up.<\/p><p>This is normal and simply how websites work. However, some files impede the browser\u2019s work without contributing to the actual page being loaded.<\/p><p>A classic example is <a href=\"https:\/\/wp-rocket.me\/blog\/how-third-party-tags-and-trackers-impact-website-performance\/\">tracking scripts<\/a> such as for Google Analytics or Facebook Pixel. They don\u2019t add to the page\u2019s design or behavior but, if they are loading at the wrong time, they can still slow it down. That\u2019s what we call render-blocking resources \u2013 files that stall out the loading process without being necessary to display the web page.<\/p><p>As mentioned, in most cases render-blocking resources will be CSS or JavaScript files. However, other files can get in the way of a web page loading as well, such as <a href=\"https:\/\/wp-rocket.me\/blog\/best-google-fonts\/\">font files<\/a> or images. While they are not strictly render-blocking (because they are critical for a website\u2019s design), you still need to optimize them so they, too, load as quickly as possible. We will talk about that below as well.<\/p><h2 class=\"wp-block-heading\">Why Eliminate Render-Blocking Resources in WordPress?<\/h2><p>We already learned that the problem with render-blocking resources is that they make your website appear slower.<\/p><p>Why is this significant?<\/p><p>Because website speed is a major driver of user experience. That means, how much or how little visitors enjoy interacting with your website. If you have ever navigated away from another site because it took too long to load, you know exactly what we are talking about. More often than not, you would probably rather click on another result than spend your time waiting. Your visitors feel the same way.<\/p><p>There are also many studies to back up these findings. Even small changes in loading speed can have a <a href=\"https:\/\/www.thinkwithgoogle.com\/marketing-strategies\/app-and-mobile\/mobile-page-speed-data\/\">significant impact<\/a> on the success metrics of your website.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"390\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/google-study-mobile-site-speed-conversion-rates.jpg\" alt=\"\" class=\"wp-image-6673446\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/google-study-mobile-site-speed-conversion-rates.jpg 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/google-study-mobile-site-speed-conversion-rates-310x151.jpg 310w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/google-study-mobile-site-speed-conversion-rates-768x374.jpg 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/google-study-mobile-site-speed-conversion-rates-123x60.jpg 123w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/google-study-mobile-site-speed-conversion-rates-185x90.jpg 185w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure><p>Google and other search engines know that web surfers prefer fast websites. They also want to provide their users with the best possible search results. As a consequence, website performance has become an important ranking factor.<\/p><p>Google especially has put a lot more emphasis on user experience with the introduction of Core Web Vitals and render-blocking resources can impact several of these metrics:<\/p><ul class=\"wp-block-list\"><li><a href=\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/improve-largest-contentful-paint\/\">Largest Contentful Paint<\/a><\/li>\n\n<li><a href=\"https:\/\/wp-rocket.me\/lighthouse-performance-score-wordpress\/reduce-total-blocking-time\/\">Total Blocking Time<\/a><\/li>\n\n<li><a href=\"https:\/\/wp-rocket.me\/lighthouse-performance-score-wordpress\/improve-first-contentful-paint\/\">First Contentful Paint<\/a><\/li>\n\n<li><a href=\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/improve-interaction-to-next-paint\/\">Interaction to Next Paint<\/a><\/li><\/ul><p>The first three alone make up 65% of the <a href=\"https:\/\/googlechrome.github.io\/lighthouse\/scorecalc\/\">Lighthouse speed scoring system<\/a>.&nbsp;&nbsp;<\/p><figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1083\" height=\"526\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/lighthouse-scoring-calculator.jpg\" alt=\"\" class=\"wp-image-6673454\" style=\"aspect-ratio:2.05893536121673;width:800px;height:auto\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/lighthouse-scoring-calculator.jpg 1083w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/lighthouse-scoring-calculator-310x151.jpg 310w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/lighthouse-scoring-calculator-768x373.jpg 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/lighthouse-scoring-calculator-124x60.jpg 124w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/lighthouse-scoring-calculator-185x90.jpg 185w\" sizes=\"(max-width: 1083px) 100vw, 1083px\" \/><\/figure><p>In short, render-blocking resources directly impact both the user perception of your WordPress site as well as its ranking in search engines. So, if speed testing tools are telling you that you have a problem in this area, you better heed their advice.<\/p><h2 class=\"wp-block-heading\">How to Find Problematic Files<\/h2><p>Before you can start fixing problems with render-blocking resources on your site, you first need to find out which files are causing them. Here\u2019s how to do that.<\/p><h3 class=\"wp-block-heading\">Using PageSpeed Insights<\/h3><p>The easiest way is to run your site through <a href=\"https:\/\/pagespeed.web.dev\/\">PageSpeed Insights<\/a>. Simply enter your website URL and start the analysis.<\/p><p>Once done, besides a whole wealth of information about the performance of your website, you will find the recommendation to eliminate render-blocking resources under <em>Diagnostics<\/em>.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"956\" height=\"648\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/eliminate-render-blocking-resources-diagnostic-in-pagespeed-insights.jpg\" alt=\"\" class=\"wp-image-6673460\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/eliminate-render-blocking-resources-diagnostic-in-pagespeed-insights.jpg 956w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/eliminate-render-blocking-resources-diagnostic-in-pagespeed-insights-288x195.jpg 288w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/eliminate-render-blocking-resources-diagnostic-in-pagespeed-insights-768x521.jpg 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/eliminate-render-blocking-resources-diagnostic-in-pagespeed-insights-89x60.jpg 89w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/eliminate-render-blocking-resources-diagnostic-in-pagespeed-insights-133x90.jpg 133w\" sizes=\"(max-width: 956px) 100vw, 956px\" \/><\/figure><p>PageSpeed Insights will also list the files responsible for slowing down your page loading time. That way, you know exactly where to start.<\/p><h3 class=\"wp-block-heading\">Other Tools<\/h3><p>Besides that, there are a number of other online tools that will help you find render-blocking resources on your WordPress site:<\/p><ul class=\"wp-block-list\"><li><a href=\"https:\/\/developer.chrome.com\/docs\/lighthouse\/overview\">Lighthouse<\/a> \u2013 Integrated into Chrome developer tools, Lighthouse runs the same checks that you see in PageSpeed Insights, just directly in the browser. You also find information about render-blocking resources under <em>Diagnostics<\/em>.<\/li>\n\n<li><a href=\"https:\/\/gtmetrix.com\/\">GTmetrix<\/a> \u2013 This is a tool similar to PageSpeed Insights. It can give you detailed information about your site\u2019s performance, including render-blocking resources. You can find information about that in the <em>Structure<\/em> tab of the results.<\/li>\n\n<li><a href=\"https:\/\/www.webpagetest.org\/\">WebPageTest<\/a> \u2013 Yet another speed testing tool. Simply enter your URL and run it. If there are issues with JavaScript and CSS files impeding the loading process, you will find this information under <em>Opportunities &amp; Experiments<\/em> in the test results.<\/li><\/ul><h2 class=\"wp-block-heading\">How to Get Rid of Render-Blocking Resources in WordPress (With and Without a Plugin)<\/h2><p>Now comes the most important part: how do you actually deal with the files impeding your site\u2019s loading process? We will answer this question in detail in the following.<\/p><p>You\u2019ll learn how to handle problematic files using both manual methods as well as our very own <a href=\"https:\/\/wp-rocket.me\/features\/\">WP Rocket plugin<\/a>, which makes the process much easier.<\/p><h3 class=\"wp-block-heading\">1. Optimize CSS Delivery<\/h3><p>The first thing we will deal with is how to improve the way your website handles CSS files.<\/p><h4 class=\"wp-block-heading\">Avoid Using the @import Rule<\/h4><p>A very basic step to eliminate render-blocking CSS on your WordPress site is to make sure to deliver it to the browser in the correct way. Here, it\u2019s a good idea to avoid doing so using <em>@import<\/em>.<\/p><p>With <em>@import<\/em>, you can reference and import other CSS files inside style sheets. While this has very practical applications, it can also result in render-blocking request chains.<\/p><p>Because the browser has to download a second CSS file to process the original style sheet, it can cause a significant delay in your site\u2019s loading. Therefore, it\u2019s best to avoid this method.<\/p><p>Instead, call the style sheets separately via links in the document head. If you want the browser to prioritize one of them, you can tell it to do so via <em>rel=&#8221;preload&#8221;<\/em>.<\/p><pre class=\"wp-block-code\"><code class=\"\">&lt;link rel=\"preload\" href=\"important.css\" as=\"style\" \/&gt;\n<\/code><\/pre><h4 class=\"wp-block-heading\">Check for Unused Code<\/h4><p>Most web pages come with a ton of code they are not actually using, especially CSS. You can easily see that when you open up the <a href=\"https:\/\/developer.chrome.com\/docs\/devtools\/coverage\"><em>Coverage<\/em><\/a> tab in your browser developer tools.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1450\" height=\"757\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/coverage-tab-showing-unused-code.jpg\" alt=\"\" class=\"wp-image-6673470\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/coverage-tab-showing-unused-code.jpg 1450w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/coverage-tab-showing-unused-code-310x162.jpg 310w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/coverage-tab-showing-unused-code-768x401.jpg 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/coverage-tab-showing-unused-code-115x60.jpg 115w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/coverage-tab-showing-unused-code-172x90.jpg 172w\" sizes=\"(max-width: 1450px) 100vw, 1450px\" \/><\/figure><p>It shows you what code was loaded versus what was actually used to render the page. The difference is often staggering.<\/p><p>This is not incompetence. It simply stems from the fact that style sheets cover all kinds of website elements that don\u2019t always appear on each page, from forms to widgets. That\u2019s how you end up with that much unused markup.<\/p><p>At the same time, naturally, this markup takes up loading time and bandwidth without having a purpose, making your website slower in the process.<\/p><p>So, the first step is to eliminate code that is unnecessary. Because if it\u2019s not being loaded, it can\u2019t block anything. Makes sense, doesn\u2019t it? You have two main options for that.<\/p><h4 class=\"wp-block-heading\">Inline Critical Path CSS<\/h4><p>The first is to extract the <a href=\"https:\/\/wp-rocket.me\/blog\/critical-css\/\">critical path CSS<\/a> (meaning the markup that is absolutely necessary for displaying your page) and including it directly in the document head instead of its own file.<\/p><p>So, instead of linking to a style sheet, you would have the CSS markup right in the HTML file, like so:<\/p><pre class=\"wp-block-code\"><code class=\"\">&lt;!DOCTYPE HTML&gt;\n\n&lt;html&gt;\n\n&lt;head&gt;\n\n&lt;title&gt;Your Website Title&lt;\/title&gt;\n\n&lt;meta name=\"description\" content=\"website description\" \/&gt;\n\n&lt;meta http-equiv=\"content-type\" content=\"text\/html; charset=UTF-8\" \/&gt;\n\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;style&gt;article,footer,header,main,nav{display:block}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}&lt;\/style&gt;\n\n&lt;link rel=\"stylesheet\" type=\"text\/css\" href=\"style\/style.css\" title=\"style\" \/&gt;&nbsp;&nbsp;\n\n&lt;\/head&gt;<\/code><\/pre><p>To find out the critical path CSS for a web page, you can use a tool like <a href=\"https:\/\/www.sitelocity.com\/critical-path-css-generator\">Sitelocity<\/a> or <a href=\"https:\/\/purgecss.com\/\">PurgeCSS<\/a>.<\/p><figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/ivJxNffEQB6q65-hiGOmJpU-y-CnSp7G2bqFt5AYkZW2Y6ylGEuzTsVD3iYp8h9w9tzeDh2LC9RXjAK8rr1DjZLqe4qMZF7cvP2Llp4KbOcW5MH9SBiETNajV6eYZEYbeNDampN6tUraqVyr3fdywN4\" alt=\"\"\/><\/figure><p>That way, you don\u2019t have to figure it out manually.<\/p><h4 class=\"wp-block-heading\">Split CSS Files<\/h4><p>Another option you have to eliminate render-blocking resources on your WordPress site is to split your CSS files for different screen sizes and load them only when necessary using the <a href=\"https:\/\/www.w3schools.com\/tags\/att_media.asp\">media attribute<\/a>. For example, you might have files such as:<\/p><ul class=\"wp-block-list\"><li>main.css<\/li>\n\n<li>small.css<\/li>\n\n<li>medium.css<\/li>\n\n<li>large.css<\/li><\/ul><p>You would then have the browser load these only for certain screen resolutions like so:<\/p><pre class=\"wp-block-code\"><code class=\"\">&lt;link rel=\"stylesheet\" href=\"main.css\" media=\"all\"&gt;\n&lt;link rel=\"stylesheet\" href=\"small.css\" media=\"(min-width: 320px)\"&gt;\n&lt;link rel=\"stylesheet\" href=\"medium.css\" media=\"(min-width: 768px)\"&gt;\n&lt;link rel=\"stylesheet\" href=\"large.css\" media=\"(min-width: 1200px)\"&gt;\n<\/code><\/pre><p>You can extract CSS from large files with media queries using <a href=\"https:\/\/www.npmjs.com\/package\/postcss-extract-media-query\">PostCSS<\/a> so you don\u2019t have to split them manually.<\/p><h4 class=\"wp-block-heading\">Alternatively, Use WP Rocket<\/h4><p>If the above sounds too complicated, you can tackle render-blocking resources automatically using WP Rocket. With the plugin active on your site, go to the <em>File Optimization<\/em> menu. Here, simply check the box that says <em>Optimize CSS delivery<\/em>, confirm your choice (there is a little warning), save, and the plugin will automatically reduce\/remove unused CSS from your pages so they load faster.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1192\" height=\"688\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/remove-unused-css-in-wp-rocket.jpg\" alt=\"\" class=\"wp-image-6673482\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/remove-unused-css-in-wp-rocket.jpg 1192w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/remove-unused-css-in-wp-rocket-310x179.jpg 310w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/remove-unused-css-in-wp-rocket-768x443.jpg 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/remove-unused-css-in-wp-rocket-104x60.jpg 104w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/remove-unused-css-in-wp-rocket-156x90.jpg 156w\" sizes=\"(max-width: 1192px) 100vw, 1192px\" \/><\/figure><p>Finally, there\u2019s also the option to load CSS asynchronously (you\u2019ll learn what that means in the next section) instead of removing unused CSS.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"936\" height=\"528\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/load-css-asynchronously.jpg\" alt=\"\" class=\"wp-image-6673492\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/load-css-asynchronously.jpg 936w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/load-css-asynchronously-310x175.jpg 310w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/load-css-asynchronously-768x433.jpg 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/load-css-asynchronously-106x60.jpg 106w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/load-css-asynchronously-160x90.jpg 160w\" sizes=\"(max-width: 936px) 100vw, 936px\" \/><\/figure><p>Note, however, that this is only a fallback option if you encounter an issue and that removing unused CSS is the recommended method.<\/p><h3 class=\"wp-block-heading\">2. Deal With Render-Blocking JavaScript<\/h3><p>Next up, we\u2019ll work on problematic JavaScript files.<\/p><h4 class=\"wp-block-heading\">async and defer<\/h4><p>The two main tools you have for preventing scripts from delaying your page\u2019s from rendering are the <em>async<\/em> and <em>defer<\/em> attributes. You can add them to your calls in the code like so:<\/p><pre class=\"wp-block-code\"><code class=\"\">&lt;script async src=\"important.js\"&gt;&lt;\/script&gt;\n\n&lt;script defer src=\"also-important.js\"&gt;&lt;\/script&gt;<\/code><\/pre><p>Both of these attributes do very similar things. They prevent your visitor\u2019s browser from pausing the site loading process when it encounters a JavaScript file. However, they do so in slightly different ways and, therefore, differ in how to use them:<\/p><ul class=\"wp-block-list\"><li><strong>async <\/strong>\u2013 The browser will download JavaScript marked in this way in the background and only start executing it once the file has been completely downloaded. It will also execute files regardless of the order they appear in the document and instead based on when they become available.<\/li>\n\n<li><strong>defer <\/strong>\u2013 Here, the browser also downloads files in the background, however, it will only execute them once it has finished with the rest of the page. Additionally, it will adhere to the original order of the scripts.<\/li><\/ul><p>Here\u2019s an <a href=\"https:\/\/www.growingwiththeweb.com\/2014\/02\/async-vs-defer-attributes.html\">illustration<\/a> to make it clearer:<\/p><figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"342\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/async-vs-defer-growingwiththeweb.png\" alt=\"\" class=\"wp-image-6673501\" style=\"aspect-ratio:2.3391812865497075;width:800px;height:auto\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/async-vs-defer-growingwiththeweb.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/async-vs-defer-growingwiththeweb-310x133.png 310w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/async-vs-defer-growingwiththeweb-768x328.png 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/async-vs-defer-growingwiththeweb-140x60.png 140w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/async-vs-defer-growingwiththeweb-211x90.png 211w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure><p>When should you use what?<\/p><p>Use <em>defer<\/em> for files where the order matters. That\u2019s usually because they rely on a previous file being present when running. Otherwise, you might encounter problems. A common example is when sites use jQuery and try to execute some of its functionality before the jQuery library has been loaded.<\/p><p>The <em>async<\/em> attribute, on the other hand, is for files that are completely independent of the rest of the page document, such as the aforementioned tracking scripts.<\/p><p>It\u2019s important to note that you can theoretically also load CSS asynchronously. However, that\u2019s a bit more complicated than we can cover here. You can find instructions over at <a href=\"https:\/\/web.dev\/articles\/defer-non-critical-css\">web.dev<\/a>.<\/p><h4 class=\"wp-block-heading\">Split JavaScript Files<\/h4><p>Another step you can take to prevent your site\u2019s JavaScript from being render-blocking is to split your files. That\u2019s similar to what we discussed for CSS. It reduces the time it takes for the browser to process each file, so it isn\u2019t blocked as long from loading the page. It also keeps your site responsive to user input, which is important for the Interaction to Next Paint metric.<\/p><p>When using Chrome developer tools to analyze the performance of your website, it will warn you of particularly long JavaScript tasks with a red triangle.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1021\" height=\"354\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/long-tasks-in-chrome-developer-tools.jpg\" alt=\"\" class=\"wp-image-6673512\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/long-tasks-in-chrome-developer-tools.jpg 1021w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/long-tasks-in-chrome-developer-tools-310x107.jpg 310w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/long-tasks-in-chrome-developer-tools-768x266.jpg 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/long-tasks-in-chrome-developer-tools-173x60.jpg 173w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/long-tasks-in-chrome-developer-tools-260x90.jpg 260w\" sizes=\"(max-width: 1021px) 100vw, 1021px\" \/><\/figure><p>If that\u2019s a problem on your site, you can use bundlers like <a href=\"https:\/\/webpack.js.org\/guides\/code-splitting\/\">webpack<\/a>, <a href=\"https:\/\/browserify.org\/\">Browserify<\/a>, and <a href=\"https:\/\/rollupjs.org\/es-module-syntax\/#dynamic-import\">Rollup<\/a> to divide your JavaScript into multiple bundles that only load when needed.<\/p><h4 class=\"wp-block-heading\">WP Rocket Options<\/h4><p>WP Rocket also has options for optimizing JavaScript on your site. Again<span style=\"box-sizing: border-box; margin: 0px; padding: 0px;\">, under\u00a0<em>File Optimization<\/em>, you can determine whether\u00a0<\/span>to load it deferred and delay loading until a user interaction occurs.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"939\" height=\"1086\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/defer-and-delay-javascript-in-wp-rocket-1.jpg\" alt=\"\" class=\"wp-image-6673546\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/defer-and-delay-javascript-in-wp-rocket-1.jpg 939w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/defer-and-delay-javascript-in-wp-rocket-1-169x195.jpg 169w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/defer-and-delay-javascript-in-wp-rocket-1-768x888.jpg 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/defer-and-delay-javascript-in-wp-rocket-1-52x60.jpg 52w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/defer-and-delay-javascript-in-wp-rocket-1-78x90.jpg 78w\" sizes=\"(max-width: 939px) 100vw, 939px\" \/><\/figure><p>In addition, the plugin has the option to exclude scripts manually from being delayed to make sure that important JavaScript still loads.<\/p><h3 class=\"wp-block-heading\">3. Improve Font Loading<\/h3><p>As mentioned earlier, font files can also interfere with the loading process. While they are not strictly render-blocking, they can still be disruptive. The two most important concerns here are:<\/p><ul class=\"wp-block-list\"><li><strong>Flash of Unstyled Text (FOUT)<\/strong> \u2013 This happens when a visitor first sees your website text in a standard fallback font that changes the moment the font file loads.<\/li>\n\n<li><strong>Flash of Invisible Text (FOIT)<\/strong> \u2013 In this case, no text is visible at all at first and only appears together with the loading of the web font file.<\/li><\/ul><p>Here are ways to avoid these issues:<\/p><ul class=\"wp-block-list\"><li><strong>Use a modern font format<\/strong> \u2013 Fonts come in different file formats. The smallest and, therefore, fastest to load are usually WOFF or WOFF2.<\/li>\n\n<li><strong>Choose a fitting fallback font <\/strong>\u2013 If you define a fallback font that\u2019s very similar to your intended typeface, the switch between fonts is not as glaring. <a href=\"https:\/\/meowni.ca\/font-style-matcher\/\">Font Style Matcher<\/a> can help you find a good combination.<\/li>\n\n<li><strong>Preload fonts<\/strong> \u2013 Placing your web font files high up in the page document and adding <em>rel=preload<\/em> to its call will make the browser load them more quickly.<\/li><\/ul><p>By the way, you can easily preload font files in WP Rocket by defining their location under <em>Preload<\/em>.<\/p><figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"947\" height=\"422\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/preload-fonts-in-wp-rocket.jpg\" alt=\"\" class=\"wp-image-6673531\" style=\"aspect-ratio:2.244075829383886;width:800px;height:auto\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/preload-fonts-in-wp-rocket.jpg 947w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/preload-fonts-in-wp-rocket-310x138.jpg 310w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/preload-fonts-in-wp-rocket-768x342.jpg 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/preload-fonts-in-wp-rocket-135x60.jpg 135w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/preload-fonts-in-wp-rocket-202x90.jpg 202w\" sizes=\"(max-width: 947px) 100vw, 947px\" \/><\/figure><h3 class=\"wp-block-heading\">4. Use Compression and Minification<\/h3><p>These two techniques don\u2019t directly help eliminate render-blocking resources. However, they can still improve performance problems. Here\u2019s what each of these terms mean:<\/p><ul class=\"wp-block-list\"><li><strong>Compression <\/strong>\u2013 You are probably familiar with this concept from using zip files on your computer, which also compress data. The same is possible on a web server. Smaller website files are faster to download, which means the browser can start displaying your website more quickly.<\/li>\n\n<li><strong>Minification <\/strong>\u2013 This technique eliminates white space and comments in website files that make them more human-readable, shrinking the file size in the process.<\/li><\/ul><p>If you want to use these techniques on your WordPress website, it usually involves <a href=\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/enable-text-compression\/\">manually adding code to a server file<\/a> or running files through a tool like <a href=\"https:\/\/minify-js.com\/\">Minify JS<\/a>.<\/p><p>Alternatively, go with a plugin solution. For example, WP Rocket automatically enables GZIP file compression on your WordPress website when it becomes active. In addition, you can activate minification for both CSS and JavaScript files by checking the boxes under <em>File Optimization<\/em>.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"934\" height=\"700\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/minify-css-and-javascript-files-in-wp-rocket.jpg\" alt=\"\" class=\"wp-image-6673522\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/minify-css-and-javascript-files-in-wp-rocket.jpg 934w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/minify-css-and-javascript-files-in-wp-rocket-260x195.jpg 260w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/minify-css-and-javascript-files-in-wp-rocket-768x576.jpg 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/minify-css-and-javascript-files-in-wp-rocket-80x60.jpg 80w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/minify-css-and-javascript-files-in-wp-rocket-120x90.jpg 120w\" sizes=\"(max-width: 934px) 100vw, 934px\" \/><\/figure><h3 class=\"wp-block-heading\">5. Implement Other Optimization Techniques<\/h3><p>Besides getting rid of render-blocking resources on your WordPress site, there are other techniques you to further improve your site\u2019s performance:<\/p><ul class=\"wp-block-list\"><li><strong>Caching <\/strong>\u2013 This saves static copies of your pages as HTML files on your server. That way, it doesn\u2019t have to dynamically create them from PHP files and the database each time someone wants to view a web page.<\/li>\n\n<li><strong>Image optimization<\/strong> \u2013 While images are not render-blocking, they do have a big impact on page loading speed and need optimization as well. Compression, using the right size, and taking advantage of modern image formats like WebP and Avif all help slim down images and deliver them more quickly. <a href=\"https:\/\/wp-rocket.me\/blog\/image-optimization-wordpress\/\">Image optimization<\/a> is especially important for mobile devices.<\/li>\n\n<li><strong>Lazy loading<\/strong> \u2013 This is another technique that helps with image optimization. It tells browsers to only load images that actually appear on screen initially and defer those further down the page until the user scrolls toward them. This saves a lot of bandwidth.<\/li>\n\n<li><strong>Database optimization<\/strong> \u2013 The database contains all your website content. If it&#8217;s slow due to redundant data, this has an effect on the entire site. That\u2019s why it needs regular <a href=\"https:\/\/wp-rocket.me\/blog\/make-wordpress-database-clean-whistle\/\">optimization and cleanup<\/a>.<\/li>\n\n<li><strong>Using a content delivery network<\/strong> \u2013 A CDN spreads your static server files across different servers around the world. This allows visitors to receive them from the location nearest to them, reducing loading time.<\/li><\/ul><p>Except for image optimization, WP Rocket has functionality for all of this:<\/p><ul class=\"wp-block-list\"><li><strong>Caching<\/strong> is automatically activated upon plugin installation and you can also switch it on for mobile.<\/li>\n\n<li>You can enable <strong>lazy loading<\/strong> for images, CSS background, iframes, and videos.<\/li>\n\n<li>WP Rocket can <strong>clean up and optimize your database<\/strong>, even automatically on schedule.<\/li>\n\n<li>The plugin supports CDNs and has <strong>dedicated add-ons for popular providers<\/strong>. You can even use our own <a href=\"https:\/\/rocketcdn.me\/\">RocketCDN<\/a>.<\/li><\/ul><p>In addition, you can also check out <a href=\"https:\/\/imagify.io\/\">Imagify<\/a>, our other plugin. It can help you do all of the image optimization techniques mentioned above right on your WordPress website. Imagify uses Smart Compression to balance image quality and performance and can convert visuals to both WebP and Avif. It is the easiest image optimization plugin for WordPress to make images lighter.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1543\" height=\"1600\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/imagify.jpg\" alt=\"\" class=\"wp-image-6673561\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/imagify.jpg 1543w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/imagify-188x195.jpg 188w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/imagify-768x796.jpg 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/imagify-58x60.jpg 58w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/imagify-87x90.jpg 87w\" sizes=\"(max-width: 1543px) 100vw, 1543px\" \/><\/figure><h2 class=\"wp-block-heading\">Eliminating Render-Blocking Resources with a WordPress Plugin (Before-and-After Case Study)<\/h2><p>Are you still in doubt that eliminating render-blocking resources could have a significant impact on your WordPress site\u2019s performance? Then let\u2019s put those doubts to rest by putting the advice above to the test.<\/p><h3 class=\"wp-block-heading\">Test Setup and Initial Results<\/h3><p>For this case study, we set up a simple trial website using the <a href=\"https:\/\/kallyas.net\/\">Kallyas theme<\/a>. We installed one of their starter sites and all the plugins that come with it.<\/p><figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1500\" height=\"1167\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/test-website-to-eliminate-render-blocking-resources.jpg\" alt=\"\" class=\"wp-image-6673570\" style=\"aspect-ratio:1.2853470437017995;width:800px;height:auto\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/test-website-to-eliminate-render-blocking-resources.jpg 1500w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/test-website-to-eliminate-render-blocking-resources-251x195.jpg 251w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/test-website-to-eliminate-render-blocking-resources-768x598.jpg 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/test-website-to-eliminate-render-blocking-resources-77x60.jpg 77w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/test-website-to-eliminate-render-blocking-resources-116x90.jpg 116w\" sizes=\"(max-width: 1500px) 100vw, 1500px\" \/><\/figure><p>When we first ran it through PageSpeed Insights, we got the following results:<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"980\" height=\"950\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/test-website-initial-speed-results.jpg\" alt=\"\" class=\"wp-image-6673579\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/test-website-initial-speed-results.jpg 980w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/test-website-initial-speed-results-201x195.jpg 201w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/test-website-initial-speed-results-768x744.jpg 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/test-website-initial-speed-results-62x60.jpg 62w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/test-website-initial-speed-results-93x90.jpg 93w\" sizes=\"(max-width: 980px) 100vw, 980px\" \/><\/figure><p>In particular:<\/p><ul class=\"wp-block-list\"><li><strong>Performance score<\/strong>: 60 (mobile), 69 (desktop)<\/li>\n\n<li><strong>First Contentful Paint<\/strong>: 4.4 s (mobile), 1.8 s (desktop)<\/li>\n\n<li><strong>Largest Contentful Paint<\/strong>: 7.7 s (mobile), 2.2 s (desktop)<\/li>\n\n<li><strong>Total Blocking Time<\/strong>: 100 ms (mobile) version, 120 ms (desktop)<\/li><\/ul><p>In addition, note that we got the advice to take care of render-blocking resources in the test results.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"954\" height=\"541\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/test-website-diagnostics.jpg\" alt=\"\" class=\"wp-image-6673589\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/test-website-diagnostics.jpg 954w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/test-website-diagnostics-310x176.jpg 310w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/test-website-diagnostics-768x436.jpg 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/test-website-diagnostics-106x60.jpg 106w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/test-website-diagnostics-159x90.jpg 159w\" sizes=\"(max-width: 954px) 100vw, 954px\" \/><\/figure><h3 class=\"wp-block-heading\">WP Rocket Improvements and Their Effects<\/h3><p>To improve the situation, we did exactly what we described above in the WP Rocket plugin.<\/p><ul class=\"wp-block-list\"><li>Optimized CSS delivery by removing unused CSS<\/li>\n\n<li>Load JavaScript deferred and delay its execution<\/li><\/ul><p>Besides that, as mentioned, WP Rocket automatically implements a number of speed optimization techniques automatically, namely caching and compression. Note that we also enabled mobile caching manually. It is not enabled by default, and we wanted the mobile and desktop results to be comparable.<\/p><p>After doing the above, we retested the site again, this time with the following results.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"987\" height=\"954\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/pagespeed-insights-results-after-optimization.jpg\" alt=\"\" class=\"wp-image-6673595\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/pagespeed-insights-results-after-optimization.jpg 987w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/pagespeed-insights-results-after-optimization-202x195.jpg 202w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/pagespeed-insights-results-after-optimization-768x742.jpg 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/pagespeed-insights-results-after-optimization-62x60.jpg 62w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/pagespeed-insights-results-after-optimization-93x90.jpg 93w\" sizes=\"(max-width: 987px) 100vw, 987px\" \/><\/figure><p>In addition, the recommendation to eliminate render-blocking resources disappeared for both mobile and desktop.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"960\" height=\"140\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/passed-audit-render-blocking-resources.jpg\" alt=\"\" class=\"wp-image-6673604\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/passed-audit-render-blocking-resources.jpg 960w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/passed-audit-render-blocking-resources-310x45.jpg 310w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/passed-audit-render-blocking-resources-768x112.jpg 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/passed-audit-render-blocking-resources-190x28.jpg 190w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/passed-audit-render-blocking-resources-617x90.jpg 617w\" sizes=\"(max-width: 960px) 100vw, 960px\" \/><\/figure><p>Not bad for optimization that took literally a minute to implement, was it? Plus, that\u2019s not even all you can do. As mentioned, there are a whole lot of other optimization techniques you can implement with WP Rocket that we haven\u2019t even touched here. So, there is still room for improvement.<\/p><p>For example, here is the same website with code minification, lazy loading for images, and preloading options activated.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"978\" height=\"940\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/further-speed-improvements.jpg\" alt=\"\" class=\"wp-image-6673614\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/further-speed-improvements.jpg 978w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/further-speed-improvements-203x195.jpg 203w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/further-speed-improvements-768x738.jpg 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/further-speed-improvements-62x60.jpg 62w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/further-speed-improvements-94x90.jpg 94w\" sizes=\"(max-width: 978px) 100vw, 978px\" \/><\/figure><p>Here is a chart with before and after results for easier comparison:<\/p><figure class=\"wp-block-table\"><table><tbody><tr><td><\/td><td>Before<\/td><td>After<\/td><td>Change<\/td><\/tr><tr><td>Performance score (mobile)<\/td><td>60<\/td><td>92<\/td><td>+32<\/td><\/tr><tr><td>Performance score (desktop)<\/td><td>69<\/td><td>91<\/td><td>+22<\/td><\/tr><tr><td>First Contentful Paint (mobile)<\/td><td>4.4 s<\/td><td>2.1 s<\/td><td>-2.3 s<\/td><\/tr><tr><td>First Contentful Paint (desktop)<\/td><td>1.8 s<\/td><td>1.2 s<\/td><td>-0.6 s<\/td><\/tr><tr><td>Largest Contentful Paint (mobile)<\/td><td>7.7 s<\/td><td>3.0 s<\/td><td>-4.7 s<\/td><\/tr><tr><td>Largest Contentful Paint (desktop)<\/td><td>2.2 s<\/td><td>1.5 s<\/td><td>-0.7 s<\/td><\/tr><tr><td>Total Blocking Time (mobile)<\/td><td>100 ms<\/td><td>40 ms<\/td><td>-60 ms<\/td><\/tr><tr><td>Total Blocking Time (desktop)<\/td><td>120 ms<\/td><td>0 ms<\/td><td>-120 ms<\/td><\/tr><\/tbody><\/table><\/figure><h2 class=\"wp-block-heading\">Start Eliminating Render-blocking Resources Today!<\/h2><p>JavaScript and CSS files that prevent your web pages from rendering can be a main factor in making your website appear slow. They are a common factor in less-than-favorable speed tests and bad user experience.<\/p><p>Fortunately, there are plenty of things you can do to eliminate them and we have shown you the main ways to do so above. Most of it comes down to both reducing code and optimizing the way it is delivered to your visitors\u2019 browser.<\/p><p>If you feel overwhelmed by the prospect of implementing these changes yourself, you can make your life easier by using WP Rocket. It comes with all the necessary functionality to speed up your website and make render-blocking resources on your WordPress website a thing of the past.<\/p><p>As you have seen in the case study above, all you need to do is simply install the plugin, activate it, and check a few boxes. However, enabling just a few options can greatly improve your site\u2019s performance, user experience, and search ranking. <a href=\"https:\/\/wp-rocket.me\/pricing\/\">Purchase WP Rocket today<\/a> to take advantage of its powerful features immediately.<\/p>","protected":false},"excerpt":{"rendered":"<p>Are you wondering how to eliminate render-blocking resources in WordPress and improve Core Web Vitals? Find out everything you need here!<\/p>\n","protected":false},"template":"","core_web_vitals":[132],"class_list":["post-3286054","core_web_vitals_hub","type-core_web_vitals_hub","status-publish","hentry","core_web_vitals-improve-largest-contentful-paint"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Eliminate Render-Blocking Resources on WordPress<\/title>\n<meta name=\"description\" content=\"Wondering how to eliminate the render-blocking resources and improve your PageSpeed Insights score? Find out everything you need on WP Rocket!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/eliminate-render-blocking-javascript-css\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Eliminate Render-Blocking Resources on WordPress\" \/>\n<meta property=\"og:description\" content=\"Wondering how to eliminate the render-blocking resources and improve your PageSpeed Insights score? Find out everything you need on WP Rocket!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/eliminate-render-blocking-javascript-css\/\" \/>\n<meta property=\"og:site_name\" content=\"WP Rocket\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/pages\/WP-Rocket\/631942253526829\" \/>\n<meta property=\"article:modified_time\" content=\"2024-09-12T13:29:47+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/stylesheet-calls-in-document-head.jpg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@wp_rocket\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/eliminate-render-blocking-javascript-css\/\",\"url\":\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/eliminate-render-blocking-javascript-css\/\",\"name\":\"How to Eliminate Render-Blocking Resources on WordPress\",\"isPartOf\":{\"@id\":\"https:\/\/wp-rocket.me\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/eliminate-render-blocking-javascript-css\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/eliminate-render-blocking-javascript-css\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/stylesheet-calls-in-document-head.jpg\",\"datePublished\":\"2024-03-19T08:10:21+00:00\",\"dateModified\":\"2024-09-12T13:29:47+00:00\",\"description\":\"Wondering how to eliminate the render-blocking resources and improve your PageSpeed Insights score? Find out everything you need on WP Rocket!\",\"breadcrumb\":{\"@id\":\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/eliminate-render-blocking-javascript-css\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/eliminate-render-blocking-javascript-css\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/eliminate-render-blocking-javascript-css\/#primaryimage\",\"url\":\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/stylesheet-calls-in-document-head.jpg\",\"contentUrl\":\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/stylesheet-calls-in-document-head.jpg\",\"width\":875,\"height\":107},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/eliminate-render-blocking-javascript-css\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/wp-rocket.me\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Core Web Vitals\",\"item\":\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Largest Contentful Paint\",\"item\":\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/improve-largest-contentful-paint\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"How to Eliminate Render-Blocking Resources on WordPress\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/wp-rocket.me\/#website\",\"url\":\"https:\/\/wp-rocket.me\/\",\"name\":\"WP Rocket\",\"description\":\"Plugin d&#039;optimisation de sites WordPress\",\"publisher\":{\"@id\":\"https:\/\/wp-rocket.me\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/wp-rocket.me\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/wp-rocket.me\/#organization\",\"name\":\"WP Rocket\",\"url\":\"https:\/\/wp-rocket.me\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/wp-rocket.me\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/logo-wp-rocket-paypal-2.png\",\"contentUrl\":\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/logo-wp-rocket-paypal-2.png\",\"width\":150,\"height\":41,\"caption\":\"WP Rocket\"},\"image\":{\"@id\":\"https:\/\/wp-rocket.me\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/pages\/WP-Rocket\/631942253526829\",\"https:\/\/x.com\/wp_rocket\",\"https:\/\/www.youtube.com\/channel\/UC1ozThXHd1IWIZ5wkshgp_Q\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Eliminate Render-Blocking Resources on WordPress","description":"Wondering how to eliminate the render-blocking resources and improve your PageSpeed Insights score? Find out everything you need on WP Rocket!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/eliminate-render-blocking-javascript-css\/","og_locale":"en_US","og_type":"article","og_title":"How to Eliminate Render-Blocking Resources on WordPress","og_description":"Wondering how to eliminate the render-blocking resources and improve your PageSpeed Insights score? Find out everything you need on WP Rocket!","og_url":"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/eliminate-render-blocking-javascript-css\/","og_site_name":"WP Rocket","article_publisher":"https:\/\/www.facebook.com\/pages\/WP-Rocket\/631942253526829","article_modified_time":"2024-09-12T13:29:47+00:00","og_image":[{"url":"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/stylesheet-calls-in-document-head.jpg"}],"twitter_card":"summary_large_image","twitter_site":"@wp_rocket","twitter_misc":{"Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/eliminate-render-blocking-javascript-css\/","url":"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/eliminate-render-blocking-javascript-css\/","name":"How to Eliminate Render-Blocking Resources on WordPress","isPartOf":{"@id":"https:\/\/wp-rocket.me\/#website"},"primaryImageOfPage":{"@id":"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/eliminate-render-blocking-javascript-css\/#primaryimage"},"image":{"@id":"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/eliminate-render-blocking-javascript-css\/#primaryimage"},"thumbnailUrl":"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/stylesheet-calls-in-document-head.jpg","datePublished":"2024-03-19T08:10:21+00:00","dateModified":"2024-09-12T13:29:47+00:00","description":"Wondering how to eliminate the render-blocking resources and improve your PageSpeed Insights score? Find out everything you need on WP Rocket!","breadcrumb":{"@id":"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/eliminate-render-blocking-javascript-css\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/eliminate-render-blocking-javascript-css\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/eliminate-render-blocking-javascript-css\/#primaryimage","url":"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/stylesheet-calls-in-document-head.jpg","contentUrl":"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/03\/stylesheet-calls-in-document-head.jpg","width":875,"height":107},{"@type":"BreadcrumbList","@id":"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/eliminate-render-blocking-javascript-css\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/wp-rocket.me"},{"@type":"ListItem","position":2,"name":"Core Web Vitals","item":"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/"},{"@type":"ListItem","position":3,"name":"Largest Contentful Paint","item":"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/improve-largest-contentful-paint\/"},{"@type":"ListItem","position":4,"name":"How to Eliminate Render-Blocking Resources on WordPress"}]},{"@type":"WebSite","@id":"https:\/\/wp-rocket.me\/#website","url":"https:\/\/wp-rocket.me\/","name":"WP Rocket","description":"Plugin d&#039;optimisation de sites WordPress","publisher":{"@id":"https:\/\/wp-rocket.me\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wp-rocket.me\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/wp-rocket.me\/#organization","name":"WP Rocket","url":"https:\/\/wp-rocket.me\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wp-rocket.me\/#\/schema\/logo\/image\/","url":"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/logo-wp-rocket-paypal-2.png","contentUrl":"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/logo-wp-rocket-paypal-2.png","width":150,"height":41,"caption":"WP Rocket"},"image":{"@id":"https:\/\/wp-rocket.me\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/pages\/WP-Rocket\/631942253526829","https:\/\/x.com\/wp_rocket","https:\/\/www.youtube.com\/channel\/UC1ozThXHd1IWIZ5wkshgp_Q"]}]}},"_links":{"self":[{"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/core_web_vitals_hub\/3286054"}],"collection":[{"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/core_web_vitals_hub"}],"about":[{"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/types\/core_web_vitals_hub"}],"wp:attachment":[{"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/media?parent=3286054"}],"wp:term":[{"taxonomy":"core_web_vitals","embeddable":true,"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/core_web_vitals?post=3286054"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}