{"id":19083,"date":"2022-10-28T10:10:27","date_gmt":"2022-10-28T10:10:27","guid":{"rendered":"https:\/\/10web.io\/blog\/?p=19083"},"modified":"2025-04-24T11:20:33","modified_gmt":"2025-04-24T11:20:33","slug":"inline-critical-css-defer-unused-css-wordpress","status":"publish","type":"post","link":"https:\/\/10web.io\/blog\/inline-critical-css-defer-unused-css-wordpress\/","title":{"rendered":"How to Inline Critical CSS &amp; Defer Unused CSS in WordPress?"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">The \u201c<\/span><span style=\"font-weight: 400;\">Eliminate render-blocking resources&#8221; warning can be a frustrating and alarming sight, and it can also signify that your website speed is suffering. To enhance your website speed, we must first identify the cause and the factors behind the &#8220;Eliminate render-blocking resources&#8221; issue.\u00a0\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">One factor may be the myriad of plugins and themes that are installed and used on your WordPress site.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">These plugins and themes come with external files from their source, which can cause issues and slow down your website speed. More specifically, these external files include CSS files and JavaScript files, which can directly cause render-blocking.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">It is a common practice to install plugins that eventually become irrelevant or redundant, unfortunately, if not removed, they can also negatively impact the performance of your WordPress website.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Website speed is unmistakably crucial for SEO performance and is directly connected with your website\u2019s SEO ranking. To retain or enhance your search engine ranking, you must resolve any issues that are standing in the way of optimal website performance. The first step to reaching your optimal website performance is to develop your website based on the guidelines provided by<\/span><a href=\"https:\/\/pagespeed.web.dev\/\"> <span style=\"font-weight: 400;\">Page Speed Insights<\/span><\/a><span style=\"font-weight: 400;\"> (now powered by Lighthouse). The next step is to develop a website in a precise way, reducing any extra external file requests.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Let\u2019s closely examine the <a href=\"https:\/\/10web.io\/blog\/eliminate-render-blocking-resources\/\">&#8220;Eliminate render-blocking resources&#8221;<\/a> list in the Lighthouse Report. It states that \u201cresources are blocking the first paint of your website page\u201d. To resolve this issue, we can inline the critical JS\/CSS, defer the non-critical JS\/CSS and remove any unused JS\/CSS. This will positively impact your website\u2019s FCP (First Contentful Paint), LCP (Largest Contentful Paint), <\/span><span style=\"font-weight: 400;\">FID (First Input Delay), TTI (Time to Interactive), and TBT (Total Blocking Time)<\/span><span style=\"font-weight: 400;\"> metrics and will significantly enhance the loading performance of your website. <\/span><span style=\"font-weight: 400;\">On the other hand, correctly implemented critical CSS generation will not make CLS worse.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/7-742x416.png\" alt=\"\" width=\"742\" height=\"416\" class=\"alignnone size-medium wp-image-19091\" srcset=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/7-742x416.png 742w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/7-150x84.png 150w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/7-768x431.png 768w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/7-371x208.png 371w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/7.png 1484w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/7-600x336.png 600w\" sizes=\"auto, (max-width: 742px) 100vw, 742px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">In the above image, the two flagged URLs, Bootstrap and jQuery, are both third-party resources, which host a lot of unused code. If we load these files without deferring, render-blocking will most certainly occur. Therefore, to load these files while avoiding render-blocking, we must follow Lighthouse&#8217;s recommended technique of async or defer.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">If these steps seem painstakingly difficult and too technical, check the last section and see how 10Web Booster solves this problem automatically, without the need to write any code.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/10-742x416.png\" alt=\"\" width=\"742\" height=\"416\" class=\"alignnone size-medium wp-image-19094\" srcset=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/10-742x416.png 742w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/10-150x84.png 150w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/10-768x431.png 768w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/10-371x208.png 371w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/10.png 1484w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/10-600x336.png 600w\" sizes=\"auto, (max-width: 742px) 100vw, 742px\" \/><\/p>\n<h2 id=\"what-is-critical-css\"><span style=\"font-weight: 400;\">What is critical CSS?\u00a0<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">The faster your website displays its content to users, the higher the conversion rate of your website. Critical CSS refers to the essential files needed to load the \u201cAbove the Fold\u201d part of the page. When a visitor enters your website, their browser begins to load all the files on that page, which is a time-consuming process. To avoid this long loading process, Critical CSS generation requests the browser to load only the CSS <\/span><span style=\"font-weight: 400;\">affecting the initially visible content <\/span><span style=\"font-weight: 400;\">and therefore improves the perceived speed of your website.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Here is the complete picture of \u2018Above the Fold\u2019 and \u2018Below the Fold\u2019. Critical CSS renders the initial display faster.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/3-742x416.png\" alt=\"\" width=\"742\" height=\"416\" class=\"alignnone size-medium wp-image-19087\" srcset=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/3-742x416.png 742w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/3-150x84.png 150w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/3-768x431.png 768w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/3-371x208.png 371w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/3.png 1484w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/3-600x336.png 600w\" sizes=\"auto, (max-width: 742px) 100vw, 742px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">By delaying the loading of CSS files &#8220;Below the Fold&#8221;, we dramatically improve the website speed and the website&#8217;s SEO ranking. This is all quite logical. Why load something that the user cannot yet see?\u00a0 Loading CSS files &#8220;Below the Fold&#8221; only happens when they are about to be \u201cAbove the Fold\u201d.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Fast websites just don\u2019t happen out of the blue. They demand hard work. We, web developers, write markup, but the browser displays it in pixels. The code written in HTML, CSS and JavaScript, is displayed by the browser through the perfect sequence of pixels. <\/span><span style=\"font-weight: 400;\">Therefore, it is critical that the browser parses and renders the page resources as quickly as possible. This is where critical rendering comes in. By optimizing the critical rendering path, we can speed up website load time.<\/span><span style=\"font-weight: 400;\">\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">We can&#8217;t, however, speed up website load time by loading the content without proper styling as it will cause poor UX, cumulative layout shifts, flashes of unstyled text, etc. What we must do is locate the minimum styles required to render the \u201cAbove the Fold\u201d content properly.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/4-742x416.png\" alt=\"\" width=\"742\" height=\"416\" class=\"alignnone size-medium wp-image-19088\" srcset=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/4-742x416.png 742w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/4-150x84.png 150w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/4-768x431.png 768w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/4-371x208.png 371w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/4.png 1484w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/4-600x336.png 600w\" sizes=\"auto, (max-width: 742px) 100vw, 742px\" \/><\/p>\n<h2 id=\"what-is-unused-css\"><span style=\"font-weight: 400;\">What is unused CSS?<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">As the name suggests, unused CSS are entirely useless CSS files and style sheets. Why do we even have them in the first place? <\/span><span style=\"font-weight: 400;\">Well, they might be added to provide styles for other pages or devices, or just because of a mistake and later were overwritten by a web developer. They might be inside a library and are used partially (usually we don\u2019t implement all the features of CSS libraries).<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Let\u2019s take the example of adding bootstrap or font-awesome to our page. The process requires the loading of all the files of bootstrap and font-awesome. Unfortunately, most of the code will be useless, and unfortunately, it will also create a bottleneck in rendering, negatively affecting the loading time of the page. That\u2019s just how it goes. Luckily, we can do something about these unused and useless files without any impact on the web application media. So please, don\u2019t make the browser download, parse, and load unused CSS with the content and do all this extra work with absolutely no purpose. Your website certainly cannot afford the extra time.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">For a speedy website with instantaneous loading &#8220;Above the Fold&#8221;, and to satisfy your moral duty as a web developer or owner, you must remove unused CSS to save users&#8217; time. If this is something that goes beyond your skill, the WordPress plugin, 10Web Booster, the best in the market, is available to humbly serve your needs.\u00a0<\/span><\/p>\n<h2 id=\"why-should-you-remove-unused-css\"><span style=\"font-weight: 400;\">Why should you remove unused CSS?<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Now if you take care of the useless CSS files, your website load time will increase, and your website users will be impressed by the instantaneous display and incredible speed, making their interaction with your site pleasurable. They will be happy. They will visit your website again and again. You will see your website\u2019s bounce rate decrease and search engine rankings increase. All because you removed the persky useless CSS files.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Don\u2019t wait any longer, there is no time to waste. Remove all the unused plugins, unused CSS files, and unused JavaScript files. We must keep nothing but the essentials.\u00a0<\/span><\/p>\n<h2 id=\"why-should-you-inline-critical-css\"><span style=\"font-weight: 400;\">Why should you inline critical CSS?<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">When you inline critical CSS, you \u201csend a message\u201d to the browser that no other CSS files need to be downloaded in order to show the page content \u201cAbove the Fold\u201d.\u00a0 The browser will find the critical CSS available as soon as the DOM is parsed. Since style sheets block content rendering until they are fully downloaded, by removing unused CSS and using critical CSS inline, we can avoid the &#8220;eliminate render blocking&#8221; or &#8221; reduce unused CSS&#8221; flags.\u00a0<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/11-742x416.png\" alt=\"\" width=\"742\" height=\"416\" class=\"alignnone size-medium wp-image-19095\" srcset=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/11-742x416.png 742w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/11-150x84.png 150w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/11-768x431.png 768w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/11-371x208.png 371w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/11.png 1484w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/11-600x336.png 600w\" sizes=\"auto, (max-width: 742px) 100vw, 742px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">CSS files are render-blocking resources by default. This dictates that the browser will initially download and parse through all the CSS files in the head tag and execute them before visualizing the \u201cAbove the Fold\u201d page content. The larger the CSS files the greater the slowing down impact of the page speed, which in turn will increase your website&#8217;s bounce rate and decrease your website&#8217;s conversions.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Here is a comparison of website speed and bounce rate:<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/12-742x416.png\" alt=\"\" width=\"742\" height=\"416\" class=\"alignnone size-medium wp-image-19096\" srcset=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/12-742x416.png 742w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/12-150x84.png 150w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/12-768x431.png 768w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/12-371x208.png 371w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/12.png 1484w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/12-600x336.png 600w\" sizes=\"auto, (max-width: 742px) 100vw, 742px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">When you inline critical CSS, you remove a number of unnecessary steps, for example, the browser no longer needs to render the entire page content to merely visualize the content &#8220;Above the Fold&#8221;. Furthermore, the browser will easily locate the inline critical CSS in the head tag and will no longer search for critical CSS in other locations. Furthermore, since inline CSS is loaded within the &lt;style&gt;&lt;\/style&gt; tag in the &lt;head&gt;&lt;\/head&gt; section, HTTPS requests are not required. As long as the user is viewing the content &#8220;Above the fold&#8221;, non-critical CSS can be displayed asynchronously &#8220;Below the Fold&#8221;.\u00a0 However, what is important to consider is that if all CSS files were to be loaded asynchronously or deferred without inlining the critical CSS, the broken HTML content would also show, confusing your visitors.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Now you see how inlining Critical CSS, if you need to use async or defer, can significantly improve user experience by reducing page load time. Visitors will instantaneously and perfectly see &#8220;Above the Fold&#8221; content, a critical component of the initial user experience.\u00a0\u00a0<\/span><\/p>\n<h2 id=\"how-to-defer-unused-css-wordpress-without-plugin\"><b>How to Defer Unused CSS WordPress Without Plugin?<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">CSS files are render-blocking assets, which means they must be loaded and processed before the page can be loaded. WordPress themes and plugins host a great number of stylesheets, dragging load time. To resolve the load time issue, we have already explored inlining Critical CSS, now we will instruct how to defer the loading of non-critical &#8220;Below the Fold&#8221; content.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The loading of non-critical CSS too soon can slow down the website\u2019s performance. It can affect FCP (First Contentful Paint), LCP (Large Contentful Paint), and TBT (Total Blocking Time) metrics. Deferring non-critical CSS will not necessarily improve website performance. However, styles must still be loaded, therefore we must identify them and load them <\/span><span style=\"font-weight: 400;\">asynchronously.<\/span><\/p>\n<h3 id=\"how-to-use-non-critical-css-or-unused-css\"><b>How to use non-critical CSS or unused CSS<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Let\u2019s find the non-critical and unused CSS files and load them asynchronously.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Async and defer are &lt;script&gt; attributes, so we need to add the following pattern below:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\"> \r\n&lt;link rel=\"preload\" href=\"styles.css\" as=\"style\" onload=\"this.onload=null;this.rel='stylesheet'\"&gt;&lt;\/span&gt;\r\n\r\n&lt;noscript&gt;&lt;link rel=\"stylesheet\" href=\"styles.css\"&gt;&lt;\/noscript&gt;<\/span><span style=\"font-weight: 400;\">\u00a0\r\n\r\n<\/span><\/pre>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">This approach is unlike adding a standard CSS file to an HTML document. Link with rel=&#8221;preload&#8221; and as=&#8221;style&#8221; will asynchronously download the non-critical CSS files. In terms of &#8220;async&#8221;: all external CSS files will be downloaded asynchronously and the code will be executed after the download. In terms of &#8220;defer&#8221;: a CSS file will be downloaded asynchronously and executed when the parsing of the document is completed.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">The &#8220;Defer&#8221; is a Boolean attribute.\u00a0 It works only for external script documents. When it is present, the script is executed after the page performs the parsing. On the other hand, if &#8220;async&#8221; is present, the script is executed asynchronously with the rest of the page. In other words, \u201casync\u201d works while the page continues parsing, while &#8220;defer&#8221; works when the page finishes parsing. If we don\u2019t use &#8220;async&#8221; or &#8220;defer&#8221; for the external scripts, the script will execute immediately before the browser continues parsing the page. This will create a &#8220;Render-Blocking&#8221; flag for that page. It is also important to note that &#8220;async&#8221; and &#8220;defer&#8221; will have no effect on the inline code. The best technique is to inline the &#8220;Above the Fold&#8221; content and defer the &#8220;Below the Fold\u201d content.\u00a0<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">The &#8220;Onload&#8221; attribute on the link allows browsers to execute the code after the CSS file is loaded.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">&#8220;onload=null&#8221;: prevents the reuse of the CSS files\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">The noscript tag holds that if the user disables the script or if the script is not supported in a browser, it will still run the script. NoScript tags are used on either the head or the body tag.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">In the next section, we will explore how to find non-critical or unused CSS files. WordPress is riddled with these files, which is why their detection and deferring are critical.\u00a0<\/span><\/p>\n<h2 id=\"how-to-detect-unused-css\"><b>How to detect unused CSS\u00a0<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">The larger the number of external files used, the greater the likelihood and frequency of render-blocking. To reduce our chances of render-blocking, we must identify and separate critical and non-critical CSS and JS files. Chrome DevTools and PageSpeed Insights are the most common tools for the task.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Through Chrome DevTools, we can easily identify critical and non-critical CSS and JS.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Let\u2019s go through the steps.\u00a0<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">To launch Chrome DevTools press F12 or ctrl + shift + i (for Windows) or press cmd + opt + i (for Macs) or open the Chrome Menu from the right corner.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Click on the three-dot icon &#8220;<\/span><b>\u22ee<\/b><span style=\"font-weight: 400;\">&#8221; located on the right side. Open the dropdown and click on <\/span><b>More Tools, <\/b><span style=\"font-weight: 400;\">click on <\/span><b>Developer Tools<\/b><span style=\"font-weight: 400;\"> and proceed to the <\/span><b>Coverage <\/b><span style=\"font-weight: 400;\">tab.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Press to <\/span><b>Reload<\/b><span style=\"font-weight: 400;\"> to start capturing coverage. The used and unused bytes filtered by URL, JS, and CSS will be visible.\u00a0<\/span><\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/6-742x416.png\" alt=\"\" width=\"742\" height=\"416\" class=\"alignnone size-medium wp-image-19090\" srcset=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/6-742x416.png 742w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/6-150x84.png 150w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/6-768x431.png 768w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/6-371x208.png 371w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/6.png 1484w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/6-600x336.png 600w\" sizes=\"auto, (max-width: 742px) 100vw, 742px\" \/><\/p>\n<h3 id=\"pagespeed-insights\"><a href=\"https:\/\/pagespeed.web.dev\/\"><b>PageSpeed Insights<\/b><\/a><\/h3>\n<p><span style=\"font-weight: 400;\">Now we can explore the ways of PageSpeed Insights to remove non-critical CSS. First, we must conduct the performance test in &#8220;PageSpeed Insights&#8221; and identify the specific links that create the &#8220;Reduce Unused CSS&#8221; and &#8220;Reduce Unused JavaScript&#8221; flags.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/2-742x416.png\" alt=\"\" width=\"742\" height=\"416\" class=\"alignnone size-medium wp-image-19086\" srcset=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/2-742x416.png 742w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/2-150x84.png 150w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/2-768x431.png 768w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/2-371x208.png 371w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/2.png 1484w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/2-600x336.png 600w\" sizes=\"auto, (max-width: 742px) 100vw, 742px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">Let\u2019s go through the steps together.\u00a0<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">\u00a0Direct to the <\/span><a href=\"https:\/\/pagespeed.web.dev\/\"><span style=\"font-weight: 400;\">PageSpeed Insights website<\/span><\/a><span style=\"font-weight: 400;\">, enter your website\u2019s URL\u00a0 and click <\/span><b>Analyze.\u00a0<\/b><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">You will be directed to the <\/span><b>Performance <\/b><span style=\"font-weight: 400;\">section. A complete report of our website&#8217;s loading performance and a complete guideline of the opportunities to improve page speed will be presented.\u00a0\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Check for any warnings for &#8220;Reduce Unused CSS&#8221; and <a href=\"https:\/\/10web.io\/blog\/remove-unused-javascript\/\">&#8220;Reduce Unused JavaScript&#8221;<\/a>. The plugins or themes causing these issues will also be identified.\u00a0<\/span><\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/1-1-742x416.png\" alt=\"\" width=\"742\" height=\"416\" class=\"alignnone size-medium wp-image-19085\" srcset=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/1-1-742x416.png 742w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/1-1-150x84.png 150w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/1-1-768x431.png 768w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/1-1-371x208.png 371w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/1-1.png 1484w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/1-1-600x336.png 600w\" sizes=\"auto, (max-width: 742px) 100vw, 742px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">Locating the used and unused CSS through the above options requires time and a lot of technical work. <\/span><a href=\"https:\/\/purifycss.online\/\"><span style=\"font-weight: 400;\">PurifyCSS <\/span><\/a><span style=\"font-weight: 400;\">on the other hand can extract used and unused CSS within a few seconds.<\/span><\/p>\n<h3 id=\"purifycss\"><a href=\"https:\/\/purifycss.online\/\"><b>PurifyCSS<\/b><\/a><\/h3>\n<p><span style=\"font-weight: 400;\">The process is quite simple:\u00a0<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Visit PurifyCSS<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Enter the URL of your website in the designated area<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Press <\/span><b>Clean Up CSS<\/b><span style=\"font-weight: 400;\">.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Wait for the list of the used and unused CSS per percentage (%)<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Press <\/span><b>download combined purified, &amp; minified CSS\u00a0<\/b><\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/5-742x416.png\" alt=\"\" width=\"742\" height=\"416\" class=\"alignnone size-medium wp-image-19089\" srcset=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/5-742x416.png 742w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/5-150x84.png 150w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/5-768x431.png 768w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/5-371x208.png 371w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/5.png 1484w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/5-600x336.png 600w\" sizes=\"auto, (max-width: 742px) 100vw, 742px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">The use of PurifyCSS&#8217;s auto-generated code requires technical skills, otherwise, you may break your website. This was a brief on the use of PurifyCSS, we recommend following PurifyCSS&#8217;s complete instructions.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><div class=\"colored-block blue\">\n    <img decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/themes\/10web-blog\/images\/shortcodes\/\/blue_block_icon.png\" class=\"colored-block-note\" alt=\"Note\">\n            <h4>Related Article<\/h4>\n\t        <div class=\"colored-block__content\"><\/span><\/p>\n<p><a href=\"https:\/\/10web.io\/blog\/minimize-main-thread-work\/\">6 Tips to Minimize Main Thread Work on WordPress<\/a><\/p>\n<p><span style=\"font-weight: 400;\"><\/div>\n    <\/div>\n<\/span><\/p>\n<h2 id=\"how-to-properly-take-into-account-mobile-and-other-devices\"><span style=\"font-weight: 400;\">How to properly take into account mobile and other devices?<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Mobile usage is skyrocketing. When working with CSS files, you should always account for mobile and other devices, and the importance of page speed load on these devices. Loading page code for all devices, mobile and tablet, can take a long time to download, parse, and render. We can overcome this problem by using media attributes. Employing media queries can significantly reduce CSS file size for mobile and other devices. Through this method we can load only the code essential for media, reducing the CSS file size. We can split the code between mobile devices and desktop devices, reducing CSS code rules and essentially loading the code required for the specific user&#8217;s device.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Critical CSS should be generated for each device type\/size. At least two sizes for mobile and desktop. However many sites contain more fine-grained media queries that require generation of critical CSS for more than two media sizes. 10Web Booster generates critical CSS for five device sizes.<\/span><\/p>\n<h2 id=\"1-inline-critical-css-remove-or-defer-unused-css\"><span style=\"font-weight: 400;\">1. Inline critical CSS, remove or defer unused CSS<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">It was previously explained how to easily locate critical CSS and non-critical CSS using Chrome Dev Tools. After which, critical CSS should be inserted in the head section using the <\/span><span style=\"font-weight: 400;\">&lt;style&gt; <\/span><span style=\"font-weight: 400;\">tag and non-critical CSS should be removed or deferred. Content should also be synchronously tested to ensure no errors occur.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">There is no universally defined height of the above-the-fold part for inline critical CSS. A website may have completely different critical CSS, depending on the viewport device\u2019s specifications. If we look at the desktop and mobile versions of the 10Web.io website, we notice that the user interfaces of the desktop and mobile versions are completely different.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/9-742x416.png\" alt=\"\" width=\"742\" height=\"416\" class=\"alignnone size-medium wp-image-19093\" srcset=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/9-742x416.png 742w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/9-150x84.png 150w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/9-768x431.png 768w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/9-371x208.png 371w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/9.png 1484w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/9-600x336.png 600w\" sizes=\"auto, (max-width: 742px) 100vw, 742px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">For this very reason, with specific device media queries, critical CSS must be used in the head section within the &lt;style&gt; tag, while non-critical CSS should be removed or deferred.<\/span><\/p>\n<h2 id=\"2-preload-the-external-stylesheets-links-on-interaction\"><span style=\"font-weight: 400;\">2. Preload the external stylesheets links on interaction<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">A website speed test on Page Speed Insight, may also indicate a &#8220;Preload Key Requests&#8221; flag, suggesting the need for preloading links on your website; preload &lt;link rel=preload&gt;. Stylesheets, document files, images, fonts, scripts, audio, and video files can be preloaded. Preload plays a helpful role especially in solving LCP issues of images and fonts. To remove the &#8220;Preload Key Requests&#8221; flag, Pagespeed Insights suggested links should be preloaded. To add a stylesheet to WordPress, the wp_enqueue_style function must be called and the relation preload of the stylesheet must be rel=&#8221;preload&#8221;.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">For example:<\/span><\/p>\n<pre>wp_enqueue_style('preload-style', 'styles\/main-style.css', false, null);\r\n \r\nadd_filter( 'style_loader_tag', 'preload_filter', 10, 2 ); function preload_filter( $html, $handle ){\r\n \r\n if (strcmp($handle, 'preload-style') == 0) {\r\n \r\n $html = str_replace(\"rel='stylesheet'\", \"rel='preload' as='style' \", $html); } \r\n \r\nreturn $html; }<\/pre>\n<p><span style=\"font-weight: 400;\">\u00a0<\/span><\/p>\n<h2 id=\"how-to-use-the-critical-css-on-your-wordpress-website\"><b>How to use the critical CSS on your WordPress website<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Critical CSS can be used on your WordPress website through PHP by maintaining a clean header.php and inlining the critical CSS.\u00a0<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">First, add all styles to the style.css file for critical CSS within the theme.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Then, include the style.css file in the &lt;style&gt; tag in the header.php file. At this point, all styles\u00a0 become inline CSS, and all CSS will be copied to header.php.\u00a0<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">Handling critical CSS files is simple with PHP. We can use inline CSS by treating it as external CSS.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Here is an example with\u00a0 Twenty Twenty Two WordPress theme:<\/span><\/p>\n<pre>php include(\"wp-content\/themes\/twentytwentytwo\/style.css\");<\/pre>\n<p><span style=\"font-weight: 400;\">If the wp_enqueue_style function were to be added, the URL would then be generated, causing\u00a0 render-blocking. For this reason, critical CSS should be included in header.php, avoiding the <\/span><span style=\"font-weight: 400;\">\u00a0wp_enqueue_style function.<\/span><\/p>\n<h3 id=\"1-separate-critical-and-non-critical-css-for-each-media-query\"><span style=\"font-weight: 400;\">1. Separate critical and non-critical CSS for each media query<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">By separating critical CSS and non-critical CSS media queries for mobile devices, and by separating critical CSS and non-critical CSS media queries for desktop devices, we can reduce the size of the CSS file. In this case, when a page is called to load, the extracted CSS file will be loaded through CSS Media Queries &#8211; which will take into consideration the device &#8211; and will therefore reduce the loading time. Overall, by separating critical and non-critical CSS for each media query, the loading performance of the website will be faster.<\/span><\/p>\n<h3 id=\"2-inline-critical-css\"><span style=\"font-weight: 400;\">2. Inline Critical CSS<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">As noted before, inline critical CSS is the inlining of the critical CSS of the website&#8217;s primary viewport. Critical CSS is the content a visitor is served on their device before scrolling. Critical CSS loads immediately with the DOM, speeding up the loading performance of the website.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Chrome DevTools displays critical CSS as green-marked CSS and unused CSS as red-marked CSS. To improve website speed performance, the green-marked CSS should be inlined, while the red-marked CSS should be removed or asynced or deferred. Of course, executing this process by copying the codes suggested by DevsTools, one by one, is very time-consuming. Luckily there are tools that can automatically generate critical CSS.\u00a0<\/span><\/p>\n<h4><span style=\"font-weight: 400;\">Here is how to generate critical CSS automatically<\/span><\/h4>\n<p><span style=\"font-weight: 400;\">We have gone through the steps of placing the critical path CSS file as inline code within the &lt;style&gt; tag in between the head section. Now let&#8217;s go through the process of generating critical CSS automatically.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Note: Avoiding render-blocking with critical CSS is a technique that shows &#8220;Above the Fold&#8221; content as soon as possible to the user and rest CSS files can load ASYNCHRONOUSLY. <\/span><span style=\"font-weight: 400;\">Load them asynchronously on user interaction or after some time (if there is no interaction). On user interaction, e.g. on scroll, or mouse hover on the page, or key press, or touch. The idea is that if you open the page and don&#8217;t do anything yet, there is no need to load extra styles.<\/span><\/p>\n<p><a href=\"https:\/\/web.dev\/articles\/extract-critical-css\"><span style=\"font-weight: 400;\">W<\/span><span style=\"font-weight: 400;\">eb.dev<\/span><\/a><span style=\"font-weight: 400;\"> offers some recommendations and useful tools for critical CSS extraction. Manual critical CSS extraction is of course difficult and resource-intensive. Automated extraction requires the selection of the right tools to extract the critical CSS codes of the initial viewport.\u00a0<\/span><\/p>\n<h4><span style=\"font-weight: 400;\">1. Critical<\/span><\/h4>\n<p><span style=\"font-weight: 400;\">We can extract inline critical CSS from HTML pages by the use of certain tools. <\/span><a href=\"https:\/\/www.npmjs.com\/package\/critical\"><i><span style=\"font-weight: 400;\">Critical<\/span><\/i><\/a><span style=\"font-weight: 400;\"> is one such tool. It does require NPM installation. If you have NPM already installed, you can install <\/span><i><span style=\"font-weight: 400;\">Critical<\/span><\/i><span style=\"font-weight: 400;\"> on your device by following the command prompt, and then generating inline critical-path CSS. It works perfectly with standard input as well. An advantage of this tool is that it automatically detects stylesheets. That\u2019s right, there is no need to specify the stylesheets. Additionally, the tool can export dynamic CSS for multiple screen resolutions. For an example of a site using Critical Path CSS, examine the <\/span><a href=\"https:\/\/github.com\/addyosmani\/critical-path-css-demo\"><span style=\"font-weight: 400;\">Critical Path CSS Demo<\/span><\/a><span style=\"font-weight: 400;\"> on GitHub.\u00a0<\/span><\/p>\n<h4>2. <a href=\"https:\/\/github.com\/filamentgroup\/criticalCSS\"><span style=\"font-weight: 400;\">CriticalCSS<\/span><\/a><\/h4>\n<p><span style=\"font-weight: 400;\">Another very good \u201cAbove the Fold\u201d<\/span><i><span style=\"font-weight: 400;\"> Critical CSS<\/span><\/i><span style=\"font-weight: 400;\"> generator is <\/span><a href=\"https:\/\/github.com\/filamentgroup\/criticalCSS\"><span style=\"font-weight: 400;\">CriticalCSS<\/span><\/a><span style=\"font-weight: 400;\">. It also works on the NPM command line. It locates \u201cAbove the Fold\u201d CSS and delivers the output as a file. We direct you to their documentation for further detail.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">There are automatic Critical path CSS generators that do not require the command prompt.<\/span><\/p>\n<h4><span style=\"font-weight: 400;\">3. Automatic Critical Path CSS Generator: <\/span><span style=\"font-weight: 400;\">sitelocity.com<\/span><\/h4>\n<p><span style=\"font-weight: 400;\">Sitelocity.com<\/span><span style=\"font-weight: 400;\"> is an automatic Critical Path CSS Generator. It merely requires an entry of your web page to generate \u201cAbove the Fold\u201d Critical CSS.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Follow these steps to generate your\u00a0 \u201cAbove the Fold\u201d Critical CSS<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Enter the URL of your webpage, including HTTP or HTTPS.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Click the <\/span><b>Generate Critical Path CSS<\/b><span style=\"font-weight: 400;\"> button. The tool will automatically generate the Critical Path CSS, the Minified and Unminified Combined CSS file, and Minified and the Unminified Critical CSS file.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">This step does require manual effort. Download or copy the Minified or Unminified Critical CSS file and paste all its contents in between the &lt;head&gt; tag including the &lt;style&gt; tag.\u00a0<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">The below image is an example of a case without Inline Critical CSS and a case with Inline Critical CSS.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/8-742x416.png\" alt=\"\" width=\"742\" height=\"416\" class=\"alignnone size-medium wp-image-19092\" srcset=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/8-742x416.png 742w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/8-150x84.png 150w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/8-768x431.png 768w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/8-371x208.png 371w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/8.png 1484w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/8-600x336.png 600w\" sizes=\"auto, (max-width: 742px) 100vw, 742px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">Caption: First test without Inline Critical CSS. Second test with Inline Critical CSS.<\/span><\/p>\n<h3 id=\"3-add-non-critical-styles-as-an-external-stylesheet\"><span style=\"font-weight: 400;\">3. Add non-critical styles as an external stylesheet<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">You have received a warning to remove non-critical CSS from Google PageSpeed Insights while testing your web pages. You may want to do as recommended by removing the non-critical CSS. However, you should be warned, removing non-critical CSS can break your content. As we have discussed before, non-critical CSS should be async or deferred as external style sheets instead. Load non-critical CSS asynchronously or defer them to the document object.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Here is how to load CSS files asynchronously:\u00a0<\/span><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n&lt;link rel=&quot;preload&quot; href=&quot;styles.css&quot; as=&quot;style&quot; onload=&quot;this.onload=null;this.rel='stylesheet'&quot;&gt;\r\n \r\n&lt;noscript&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;styles.css&quot;&gt;&lt;\/noscript&gt;<\/pre>\n<h3 id=\"4-remove-all-original-stylesheets\"><span style=\"font-weight: 400;\">4. Remove all original stylesheets<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">Third-party CSS libraries for WordPress website themes and plugins are commonly used. However, only a small part of the code within these third-party CSS libraries are actually used on the website. The rest of the code remains unused and takes a long time to load, increasing the loading time of the website.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">To remove these CSS files and increase page load time, use the wp_deregister_style function:<\/span><\/p>\n<pre>function wp_deregister_style( $handle ) {\r\n_wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle );\r\nwp_styles()-&gt;remove( $handle );\r\n}\r\n<\/pre>\n<p><span style=\"font-weight: 400;\">\u00a0<\/span><\/p>\n<h3 id=\"5-test-your-changes-thoroughly\"><span style=\"font-weight: 400;\">5. Test your changes thoroughly<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">CSS files or CSS code that is considered non-critical, or to be removed from the website, may also be connected with the user interaction. The Ajax form, the modal dialog box, or the form validation message, are examples of such CSS files.\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">To ensure we do not remove such files check<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">All click events to remove unused CSS<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">The hover effect<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">The sub-pages, buttons, and navigation menus, and\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Check the website on different browsers and different screen sizes and viewport displays.<\/span><\/li>\n<\/ul>\n<h3 id=\"6-adjust-critical-css-code\"><span style=\"font-weight: 400;\">6. Adjust critical CSS code<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">The critical CSS code should be adjusted on the website in case you locate any CSS missing during quality assurance of the website. Your website is a window to your business and venture. Flawless and fast website performance will ensure an irrefutable reputation and successful website enterprise.\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2 id=\"the-ultimate-automated-solution\"><span style=\"font-weight: 400;\">The ultimate automated solution\u00a0<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">The steps above should be done for each page of a website. Manual or automatic approach might work well for small websites with static pages. However WordPress sites are dynamic websites and contain many pages and templates, like search results or archives. One needs to generate critical CSS every time after important content changes. For example when adding a plugin, or adding new blocks to the content. This might become a nightmare.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">There is an easy, user-friendly, no-technical-knowledge-needed alternative solution. The <\/span><a href=\"https:\/\/wordpress.org\/plugins\/tenweb-speed-optimizer\/\"><span style=\"font-weight: 400;\">10Web Booster<\/span><\/a><span style=\"font-weight: 400;\"> is a WordPress speed optimization plugin that will automate critical CSS and all other speed optimization solution features for you. It generates critical CSS for five device sizes for each page. It also updates the critical CSS automatically, triggered by plugin activation\/deactivation, post publishing\/update etc.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0It&#8217;s code-free and hassle-free.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">With 10Web Booster you will receive automatic<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Critical CSS generation\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Page cache<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">CSS &amp; HTML minification &amp; compression<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">JS minification and compression<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Image optimization<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Defer JS and CSS execution<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Image lazy load<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Font swap<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Conversion of image format to WebP<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Iframe and video lazy load<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Automated updated\u00a0<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">The 10Web Booster is a free plan that offers all these optimization solutions for up to 6 pages. 10Web Booster Pro, the premium version, has no limit to the number of pages to be optimized. 10Web Booster also works on multiple devices and up to 5 screen sizes.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">10Web Booster Pro has Cloudflare integration to deliver enterprise-tier CDN to websites optimized through the plugin.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Cloudflare is one of <a href=\"https:\/\/10web.io\/blog\/best-cdn-for-wordpress\/\">the most popular and powerful CDN providers.<\/a> It hosts the top largest worldwide network of over 275 points in over 100 countries, covering around 95% of the world\u2019s population. Within their network, content can be delivered to visitors under 100ms.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Through the 10Web and Cloudflare partnership, your website will gain access to Cloudflare&#8217;s \u201creserved-for-enterprise\u201d network and will receive automatic caching of all website\u2019s static content, including non-image content like CSS\/JavaScript files, file attachments, and others. Full-page caching will ensure the generation of a static HTML copy for your website, storage of the static copy, and delivery of the content through the largest global network. This means your visitors will receive your website content at ultra-fast speed from the server nearest to them, cutting down on the distance traveled, and ensuring the highest speed and lowest load time possible. What\u2019s more, CSS and JS files, along with fonts and media, are also minified, optimizing your webpage speed even further.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">10Web Booster and Cloudflare package will also mitigate any gaps experienced by your website due to your server limitations. <a href=\"https:\/\/10web.io\/blog\/wordpress-cdn\/\">A CDN<\/a> ensures a serverless solution and eliminates the need for auto-scaling, load balancers, and configurations. Your traffic, no matter the surging size, will be directed and load-balanced through Cloudflare\u2019s extensive CDN network, providing the scalability and reliability you need to keep your website running and at its optimal functionality. Your original server will not feel a thing, as the CDN will ensure minimal load while it distributes most of the traffic through its network.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Your website uptime will increase significantly, while downtime will dwindle into memory.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Even if your original hosting server experiences blackouts, the CDN will serve your optimized and cached pages and resources from the Cloudflare edge network, making them available to your visitors even when your server is not.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0Your website will also be secure from any hackers, attacks, or bots, aiming to cause damage to your website and your visitor&#8217;s privacy. Cloudflare is equipped with the best web firewalls and DDoS (\u200b\u200bDistributed Denial-Of-Service) protection systems and handles\u00a0 bot mitigation, anomaly detection, custom CAPTCHAs, and threat response. Nothing stands in the way of your website\u2019s protection with 10Web Booster and Cloudflare.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">As always, 10Web ensures automation. All these features and benefits are yours with a single press of a button or two.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">10Web Booster with the Cloudflare Enterprise package stands unreachable in the speed and performance optimization offered and is unbeatable in the security and protection services available to your website.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">To recap, with 10Web Booster and Cloudflare you will receive the following CDN features:\u00a0<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Automated activation and configuration\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Advanced and intuitive user interface<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Cache optimization including a full-page cache for static pages\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Static and dynamic content delivery with unparalleled speed<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Built-in image optimization and lazy loading for desktop and mobile pages<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Scalability and reliability\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Built-in DDoS protection<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Web application Firewall(WAF) and user-friendly dashboard for rule configuration\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Website, application, and network protection from attacks and bots.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">SSL capabilities or compatibility with your existing SSL without any additional configuration\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Excellent 24\/7 customer support\u00a0<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">10Web Booster may just be the comprehensive automated solution to your needs. It will deliver\u00a0<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Full frontend optimization of your entire website\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Up to 7% boost in conversions<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Up to 40% boost in visitor engagement<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Up to 53% mobile traffic engagement boost<\/span><\/li>\n<\/ul>\n<p>\r\n<style>\r\n  #ctablocks_inline_70{\r\n          background-color: #000000;\r\n        color: #ffffff;\r\n    border-radius: 6px;\r\n  }\r\n\r\n  #ctablocks_inline_70 p{\r\n    color: #ffffff;\r\n  }\r\n  #ctablocks_inline_70 .button{\r\n        background-color: rgb(51,57,241);\r\n      color: #ffffff;\r\n    border-color: #3339f1 !important;\r\n  }\r\n  #ctablocks_inline_70 .button:hover{\r\n    background: rgba(51,57,241,0.8);\r\n    color: #ffffff;\r\n    opacity: 1;\r\n  }\r\n        #ctablocks_inline_70 .ctablocks_content_info p {\r\n        padding-left: 36px;\r\n      }\r\n      #ctablocks_inline_70 .ctablocks_content_button {\r\n          margin-left: 37px;\r\n      }\r\n  @media screen and (min-width: 768px) and (max-width: 1260px) {\r\n      #ctablocks_inline_70 .ctablocks_content_button {\r\n          margin-left: 37px !important;\r\n      }\r\n  }\r\n  ;\r\n<\/style>\r\n<div id=\"ctablocks_inline_70\" class=\"ctablocks_container inline_type\r\n        \">\r\n\r\n  <div class=\"ctablocks_content clear\">\r\n    <div class=\"ctablocks_content_info\">\r\n      \r\n            <div class=\"title-wrap\">\r\n\t\t\t\t\t                  <img decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/info-icon-cta.png\" alt=\"Want to speed up your website instantly?\" title=\"Want to speed up your website instantly?\">\r\n\t\t\t\t\t            <h4>Want to speed up your website instantly?<\/h4>\r\n        <\/div>\r\n              <p>Get 90+ PageSpeed Score automatically with 10Web Booster \u26a1 <br class=\"desktop\"> On any hosting!<\/p>\r\n          <\/div>\r\n    <div class=\"ctablocks_content_button\">\r\n              <a href=\"https:\/\/10web.io\/page-speed-booster\/\" class=\"button\"  data-gtag=\"cta-70\" data-buttontype=\"cta-inline\"\r\n\t        >Try for Free<\/a>\r\n            \r\n    <\/div>\r\n  <\/div>\r\n    <\/div>\r\n<br \/>\n\r\n<style>\r\n  #ctablocks_scrollbox-with-icon_93{\r\n            color: #ffffff;\r\n    border-radius: 6px;\r\n  }\r\n\r\n  #ctablocks_scrollbox-with-icon_93 p{\r\n    color: #ffffff;\r\n  }\r\n  #ctablocks_scrollbox-with-icon_93 .button{\r\n          background-color: #3339F1;\r\n        color: #ffffff;\r\n    border-color: #3339F1 !important;\r\n  }\r\n  #ctablocks_scrollbox-with-icon_93 .button:hover{\r\n    background: rgba(51,57,241,0.8);\r\n    color: #ffffff;\r\n    opacity: 1;\r\n  }\r\n  #ctablocks_scrollbox-with-icon_93.ctablocks_container {\r\n    left: 100%;\r\n  }\r\n  @media screen and (max-width: 1300px) {\r\n      #ctablocks_scrollbox-with-icon_93.ctablocks_container {\r\n          left: 0;\r\n          margin: 0 auto;\r\n      }\r\n  }\r\n  #ctablocks_scrollbox-with-icon_93 .ctablocks_content {\r\n      background-color: #000000;\r\n  }\r\n<\/style>\r\n<div id=\"ctablocks_scrollbox-with-icon_93\" class=\"ctablocks_container scrollbox-with-icon_type\r\n      \">\r\n\r\n  <div class=\"ctablocks_content clear\">\r\n    <div class=\"ctablocks_content_info\">\r\n              <h4>Want to speed up your website instantly?<\/h4>\r\n        <h4 class=\"mobile-title\">Speed up your website automatically<\/h4>\r\n              <p>Get 90+ PageSpeed Score automatically with 10Web Booster.\r\nOn any hosting!<\/p>\r\n          <\/div>\r\n    <div class=\"ctablocks_content_button\">\r\n              <a href=\"https:\/\/10web.io\/page-speed-booster\/\" class=\"button\"  data-gtag=\"cta-93\" data-buttontype=\"cta-scrollbox-with-icon\"\r\n\t        >Try for Free<\/a>\r\n            \r\n    <\/div>\r\n  <\/div>\r\n    <span class=\"close_ctablocks\">\r\n      <img decoding=\"async\" class=\"close-icon\" src=\"https:\/\/10web.io\/blog\/wp-content\/plugins\/cta-blocks\/assets\/images\/close_w.svg\" class=\"close\">\r\n      <img decoding=\"async\" class=\"floating-icon\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Booster_White_Small.png\" alt=\"Want to speed up your website instantly?\" title=\"Want to speed up your website instantly?\">\r\n<!--      <img decoding=\"async\" class=\"arrow-icon white\" src=\"\/cta-blocks\/assets\/images\/arrow-icon.svg\" class=\"close\">\r\n-->      <img decoding=\"async\" class=\"arrow-icon purple\" src=\"https:\/\/10web.io\/blog\/wp-content\/plugins\/cta-blocks\/assets\/images\/arrow-icon-purple.svg\" class=\"close\">\r\n  <\/span>\r\n<\/div>\r\n<br \/>\n\r\n<style>\r\n    #ctablocks_exit_intent_104 {\r\n     color: #000000;\r\n        border-radius: 0px;\r\n    }\r\n\r\n    #ctablocks_exit_intent_104 p {\r\n        color: #000000;\r\n    }\r\n\r\n    #ctablocks_exit_intent_104 .button {\r\n     background-color: rgb(0,0,0);\r\n     color: #ffffff;\r\n        border-color: #000000 !important;\r\n    }\r\n\r\n    #ctablocks_exit_intent_104 .button:hover {\r\n        background: rgb(51,51,51);\r\n        color: #ffffff;\r\n        opacity: 1;\r\n    }\r\n\r\n    @media screen and (max-width: 1260px) {\r\n        #ctablocks_exit_intent_104.ctablocks_container {\r\n            left: 0;\r\n            margin: 0 auto;\r\n        }\r\n    }\r\n\r\n    #ctablocks_exit_intent_104 .ctablocks_content {\r\n        background-color: #ffffff;\r\n    }\r\n<\/style>\r\n<div id=\"ctablocks_exit_intent_104\" class=\"ctablocks_container exit_intent_type\">\r\n    <div class=\"ctablocks_inner\">\r\n        <div class=\"ctablocks_content clear\">\r\n            <div class=\"ctablocks_content_info\">\r\n\t\t        \t\t                            <h4>Speed up your website instantly<\/h4>\r\n                    <h4 class=\"mobile-title\">Speed up your website instantly<\/h4>\r\n\t\t        \t\t                            <ul>\r\n\t\t\t\t                                    <li>\r\n                                <img decoding=\"async\" class=\"img_cta_button\" src=\"https:\/\/10web.io\/blog\/wp-content\/plugins\/cta-blocks\/assets\/images\/checkmark.svg\"\r\n                                      alt=\"checkmark\">\r\n\t\t\t\t\t\t        Automatically get 90+ PageSpeed score                            <\/li>\r\n\t\t\t\t                                    <li>\r\n                                <img decoding=\"async\" class=\"img_cta_button\" src=\"https:\/\/10web.io\/blog\/wp-content\/plugins\/cta-blocks\/assets\/images\/checkmark.svg\"\r\n                                      alt=\"checkmark\">\r\n\t\t\t\t\t\t        Experience full website caching                            <\/li>\r\n\t\t\t\t                                    <li>\r\n                                <img decoding=\"async\" class=\"img_cta_button\" src=\"https:\/\/10web.io\/blog\/wp-content\/plugins\/cta-blocks\/assets\/images\/checkmark.svg\"\r\n                                      alt=\"checkmark\">\r\n\t\t\t\t\t\t        Pass Core Web Vitals with ease                            <\/li>\r\n\t\t\t\t                            <\/ul>\r\n\t\t                    <\/div>\r\n            <div class=\"ctablocks_content_button\">\r\n\t\t\t\t                    <a href=\"https:\/\/10web.io\/page-speed-booster\/\"\r\n                       class=\"button\" data-gtag=\"cta-104\"\r\n                       data-buttontype=\"cta-exit_intent\"\r\n\t                    >Try For Free<\/a>\r\n\t\t\t\t\t\t\t\t\r\n            <\/div>\r\n        <\/div>\r\n\t\t            <div class=\"ctablocks_img\">\r\n                <span class=\"close_ctablocks\">\r\n                  <img decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/plugins\/cta-blocks\/assets\/images\/close_img_new.svg\" class=\"close\">\r\n                <\/span>\r\n                <img decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/05\/simplify_WP.png\" alt=\"Speed up your website instantly\"\r\n                     title=\"Speed up your website instantly\">\r\n            <\/div>\r\n\t\t    <\/div>\r\n<\/div>\r\n\r\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The \u201cEliminate render-blocking resources&#8221; warning can be a frustrating and alarming sight, and it can also signify that your website speed is suffering. To enhance your website speed, we must first identify the cause and the factors behind the &#8220;Eliminate render-blocking resources&#8221; issue.\u00a0\u00a0 One factor may be the myriad of plugins and themes that are installed and used on your&#8230;<\/p>\n","protected":false},"author":11,"featured_media":19097,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"two_page_speed":[],"footnotes":"","tenweb_blog_toc":"<ul>\r\n\t<li>\r\n\t\t<a href=\"#what-is-critical-css\">What is critical CSS?\u00a0<\/a>\r\n\t<\/li>\r\n\t<li>\r\n\t\t<a href=\"#what-is-unused-css\">What is unused CSS?<\/a>\r\n\t<\/li>\r\n\t<li>\r\n\t\t<a href=\"#why-should-you-remove-unused-css\">Why should you remove unused CSS?<\/a>\r\n\t<\/li>\r\n\t<li>\r\n\t\t<a href=\"#why-should-you-inline-critical-css\">Why should you inline critical CSS?<\/a>\r\n\t<\/li>\r\n\t<li>\r\n\t\t<a href=\"#how-to-defer-unused-css-wordpress-without-plugin\">How to Defer Unused CSS WordPress Without Plugin?<\/a>\r\n\t\t<ul>\r\n\t\t\t<li>\r\n\t\t\t\t<a href=\"#how-to-use-non-critical-css-or-unused-css\">How to use non-critical CSS or unused CSS<\/a>\r\n\t\t\t<\/li>\r\n\t\t<\/ul>\r\n\t<\/li>\r\n\t<li>\r\n\t\t<a href=\"#how-to-detect-unused-css\">How to detect unused CSS\u00a0<\/a>\r\n\t\t<ul>\r\n\t\t\t<li>\r\n\t\t\t\t<a href=\"#pagespeed-insights\">PageSpeed Insights<\/a>\r\n\t\t\t<\/li>\r\n\t\t\t<li>\r\n\t\t\t\t<a href=\"#purifycss\">PurifyCSS<\/a>\r\n\t\t\t<\/li>\r\n\t\t<\/ul>\r\n\t<\/li>\r\n\t<li>\r\n\t\t<a href=\"#how-to-properly-take-into-account-mobile-and-other-devices\">How to properly take into account mobile and other devices?<\/a>\r\n\t<\/li>\r\n\t<li>\r\n\t\t<a href=\"#1-inline-critical-css-remove-or-defer-unused-css\">1. Inline critical CSS, remove or defer unused CSS<\/a>\r\n\t<\/li>\r\n\t<li>\r\n\t\t<a href=\"#2-preload-the-external-stylesheets-links-on-interaction\">2. Preload the external stylesheets links on interaction<\/a>\r\n\t<\/li>\r\n\t<li>\r\n\t\t<a href=\"#how-to-use-the-critical-css-on-your-wordpress-website\">How to use the critical CSS on your WordPress website<\/a>\r\n\t\t<ul>\r\n\t\t\t<li>\r\n\t\t\t\t<a href=\"#1-separate-critical-and-non-critical-css-for-each-media-query\">1. Separate critical and non-critical CSS for each media query<\/a>\r\n\t\t\t<\/li>\r\n\t\t\t<li>\r\n\t\t\t\t<a href=\"#2-inline-critical-css\">2. Inline Critical CSS<\/a>\r\n\t\t\t<\/li>\r\n\t\t\t<li>\r\n\t\t\t\t<a href=\"#3-add-non-critical-styles-as-an-external-stylesheet\">3. Add non-critical styles as an external stylesheet<\/a>\r\n\t\t\t<\/li>\r\n\t\t\t<li>\r\n\t\t\t\t<a href=\"#4-remove-all-original-stylesheets\">4. Remove all original stylesheets<\/a>\r\n\t\t\t<\/li>\r\n\t\t\t<li>\r\n\t\t\t\t<a href=\"#5-test-your-changes-thoroughly\">5. Test your changes thoroughly<\/a>\r\n\t\t\t<\/li>\r\n\t\t\t<li>\r\n\t\t\t\t<a href=\"#6-adjust-critical-css-code\">6. Adjust critical CSS code<\/a>\r\n\t\t\t<\/li>\r\n\t\t<\/ul>\r\n\t<\/li>\r\n\t<li>\r\n\t\t<a href=\"#the-ultimate-automated-solution\">The ultimate automated solution\u00a0<\/a>\r\n\t<\/li>\r\n<\/ul>\r\n","tenweb_blog_competitor_type":"","tenweb_blog_competitor_names":"","tenweb_blog_twb_version":0,"tenweb_blog_type":"on"},"categories":[465],"tags":[],"class_list":["post-19083","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-speed"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v23.0 (Yoast SEO v23.0) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Inline Critical CSS and Defer Unused CSS in WordPress<\/title>\n<meta name=\"description\" content=\"Website speed is crucial for SEO. To help you with improving speed score you will need to inline critical CSS and defer unused CSS\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/10web.io\/blog\/inline-critical-css-defer-unused-css-wordpress\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Inline Critical CSS &amp; Defer Unused CSS in WordPress?\" \/>\n<meta property=\"og:description\" content=\"Website speed is crucial for SEO. To help you with improving speed score you will need to inline critical CSS and defer unused CSS\" \/>\n<meta property=\"og:url\" content=\"https:\/\/10web.io\/blog\/inline-critical-css-defer-unused-css-wordpress\/\" \/>\n<meta property=\"og:site_name\" content=\"10Web - Build &amp; Host Your WordPress Website\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/10Web.io\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-10-28T10:10:27+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-24T11:20:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/0_featured-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1484\" \/>\n\t<meta property=\"og:image:height\" content=\"832\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Tigran Nazaryan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@10Web_io\" \/>\n<meta name=\"twitter:site\" content=\"@10Web_io\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Tigran Nazaryan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"23 minutes\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Inline Critical CSS and Defer Unused CSS in WordPress","description":"Website speed is crucial for SEO. To help you with improving speed score you will need to inline critical CSS and defer unused CSS","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:\/\/10web.io\/blog\/inline-critical-css-defer-unused-css-wordpress\/","og_locale":"en_US","og_type":"article","og_title":"How to Inline Critical CSS &amp; Defer Unused CSS in WordPress?","og_description":"Website speed is crucial for SEO. To help you with improving speed score you will need to inline critical CSS and defer unused CSS","og_url":"https:\/\/10web.io\/blog\/inline-critical-css-defer-unused-css-wordpress\/","og_site_name":"10Web - Build &amp; Host Your WordPress Website","article_publisher":"https:\/\/www.facebook.com\/10Web.io\/","article_published_time":"2022-10-28T10:10:27+00:00","article_modified_time":"2025-04-24T11:20:33+00:00","og_image":[{"width":1484,"height":832,"url":"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/0_featured-1.png","type":"image\/png"}],"author":"Tigran Nazaryan","twitter_card":"summary_large_image","twitter_creator":"@10Web_io","twitter_site":"@10Web_io","twitter_misc":{"Written by":"Tigran Nazaryan","Est. reading time":"23 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/10web.io\/blog\/inline-critical-css-defer-unused-css-wordpress\/#article","isPartOf":{"@id":"https:\/\/10web.io\/blog\/inline-critical-css-defer-unused-css-wordpress\/"},"author":{"name":"Tigran Nazaryan","@id":"https:\/\/10web.io\/blog\/#\/schema\/person\/9466e64f67fc213397b384bbe3af3bd0"},"headline":"How to Inline Critical CSS &amp; Defer Unused CSS in WordPress?","datePublished":"2022-10-28T10:10:27+00:00","dateModified":"2025-04-24T11:20:33+00:00","mainEntityOfPage":{"@id":"https:\/\/10web.io\/blog\/inline-critical-css-defer-unused-css-wordpress\/"},"wordCount":4654,"commentCount":2,"publisher":{"@id":"https:\/\/10web.io\/blog\/#organization"},"image":{"@id":"https:\/\/10web.io\/blog\/inline-critical-css-defer-unused-css-wordpress\/#primaryimage"},"thumbnailUrl":"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/0_featured-1.png","articleSection":["Page Speed"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/10web.io\/blog\/inline-critical-css-defer-unused-css-wordpress\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/10web.io\/blog\/inline-critical-css-defer-unused-css-wordpress\/","url":"https:\/\/10web.io\/blog\/inline-critical-css-defer-unused-css-wordpress\/","name":"How to Inline Critical CSS and Defer Unused CSS in WordPress","isPartOf":{"@id":"https:\/\/10web.io\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/10web.io\/blog\/inline-critical-css-defer-unused-css-wordpress\/#primaryimage"},"image":{"@id":"https:\/\/10web.io\/blog\/inline-critical-css-defer-unused-css-wordpress\/#primaryimage"},"thumbnailUrl":"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/0_featured-1.png","datePublished":"2022-10-28T10:10:27+00:00","dateModified":"2025-04-24T11:20:33+00:00","description":"Website speed is crucial for SEO. To help you with improving speed score you will need to inline critical CSS and defer unused CSS","breadcrumb":{"@id":"https:\/\/10web.io\/blog\/inline-critical-css-defer-unused-css-wordpress\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/10web.io\/blog\/inline-critical-css-defer-unused-css-wordpress\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/10web.io\/blog\/inline-critical-css-defer-unused-css-wordpress\/#primaryimage","url":"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/0_featured-1.png","contentUrl":"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/10\/0_featured-1.png","width":1484,"height":832},{"@type":"BreadcrumbList","@id":"https:\/\/10web.io\/blog\/inline-critical-css-defer-unused-css-wordpress\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/10web.io\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Inline Critical CSS &amp; Defer Unused CSS in WordPress?"}]},{"@type":"WebSite","@id":"https:\/\/10web.io\/blog\/#website","url":"https:\/\/10web.io\/blog\/","name":"10Web Blog - Build & Host Your WordPress Website","description":"10Web is an All-in-One Website Building Platform, offering Managed WordPress Hosting on Google Cloud, Beautiful Templates, Premium Plugins and Services.","publisher":{"@id":"https:\/\/10web.io\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/10web.io\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/10web.io\/blog\/#organization","name":"10Web","url":"https:\/\/10web.io\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/10web.io\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2025\/04\/Logo-768x686-1.png","contentUrl":"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2025\/04\/Logo-768x686-1.png","width":768,"height":686,"caption":"10Web"},"image":{"@id":"https:\/\/10web.io\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/10Web.io\/","https:\/\/x.com\/10Web_io","https:\/\/www.instagram.com\/10web.io\/","https:\/\/www.linkedin.com\/company\/10web\/mycompany\/","https:\/\/www.youtube.com\/c\/10Web"]},{"@type":"Person","@id":"https:\/\/10web.io\/blog\/#\/schema\/person\/9466e64f67fc213397b384bbe3af3bd0","name":"Tigran Nazaryan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/10web.io\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/ce2393558e7591a237212f11acac58fb?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ce2393558e7591a237212f11acac58fb?s=96&d=mm&r=g","caption":"Tigran Nazaryan"},"description":"Tigran Nazaryan is an experienced science and technology professional. After seeing great potential in the automation of web development, he co-founded and became CInO of 10Web. Tigran is passionate about creating solutions to bring AI automation into web development and turning great ideas into powerful technological achievements.","sameAs":["https:\/\/www.linkedin.com\/in\/tnazaryan\/"],"url":"https:\/\/10web.io\/blog\/author\/tigran\/"}]}},"acf":[],"_links":{"self":[{"href":"https:\/\/10web.io\/blog\/wp-json\/wp\/v2\/posts\/19083","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/10web.io\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/10web.io\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/10web.io\/blog\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/10web.io\/blog\/wp-json\/wp\/v2\/comments?post=19083"}],"version-history":[{"count":0,"href":"https:\/\/10web.io\/blog\/wp-json\/wp\/v2\/posts\/19083\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/10web.io\/blog\/wp-json\/wp\/v2\/media\/19097"}],"wp:attachment":[{"href":"https:\/\/10web.io\/blog\/wp-json\/wp\/v2\/media?parent=19083"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/10web.io\/blog\/wp-json\/wp\/v2\/categories?post=19083"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/10web.io\/blog\/wp-json\/wp\/v2\/tags?post=19083"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}