{"id":19987,"date":"2023-02-20T12:17:14","date_gmt":"2023-02-20T12:17:14","guid":{"rendered":"https:\/\/10web.io\/blog\/?p=19987"},"modified":"2026-02-22T12:48:43","modified_gmt":"2026-02-22T12:48:43","slug":"remove-unused-javascript","status":"publish","type":"post","link":"https:\/\/10web.io\/blog\/remove-unused-javascript\/","title":{"rendered":"How to Remove Unused JavaScript on WordPress Automatically"},"content":{"rendered":"<p><audio src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/04\/Remove-Unused-JavaScript.mp3\" controls=\"controls\" data-title=\"Listen to the article\" data-duration=\"16 minutes\"><span data-mce-type=\"bookmark\" style=\"width: 0px; overflow: hidden; line-height: 0;\" class=\"mce_SELRES_start\">\ufeff<\/span><\/audio><\/p>\n<p>If you&#8217;re someone managing a website, you&#8217;ll likely be familiar with the &#8220;reduce unused JavaScript&#8221; message that pops up on a website checking tool whenever you have some irrelevant JavaScript code on specific web pages. For instance, you may have seen the message when you checked your website through PageSpeed Insights &#8211; an online website testing tool &#8211; and want to optimize your site to eliminate the error. On the face of it, the message seems straightforward: remove unused JavaScript code to <a href=\"https:\/\/10web.io\/page-speed-booster\/\">improve your website speed<\/a> and performance. But there&#8217;s a lot more that goes on behind the scenes.<\/p>\n<p>And as a website manager or owner, is it something that should cause worry? Does it affect a website&#8217;s rank on Google? And what about user experience? More importantly, what can you do to fix it? If you&#8217;re looking for answers to all of these questions, this article will explain in detail what the message means, what causes it to come up as a problem on website checking tools, and what common manual fixes you can implement to eliminate it.<\/p>\n<p>Of course, manual fixes may only solve the problem for the time being. As you add more elements to your website to make it more interactive and visually appealing, you will likely have to reduce unused JavaScript once again. As such, the article will also discuss efficient tools which can quickly identify the root cause of the issue and prevent you from resolving it repeatedly. So, let&#8217;s start by first looking into what it means to reduce unused JavaScript.<\/p>\n<div class=\"links-list-block\">\n    <p class=\"links-list-block__title\">In This Article<\/p>\n    <div class=\"links-list-block__content\">\n<ul>\n<li><a href=\"#what\">What is unused JavaScript and how to identify the causes?<\/a><\/li>\n<li><a href=\"#identify\">How to identify unused JavaScript?<\/a>\n<ul>\n<li><a href=\"#pagespeed\">Checking from PageSpeed Insights<\/a><\/li>\n<li><a href=\"#gtmetrix\">Checking from GTMetrix<\/a><\/li>\n<li><a href=\"#chrome\">Using Google Chrome\u2019s Developer Tools<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#ux-seo\">How are UX and SEO affected by unused JavaScript files?<\/a><\/li>\n<li><a href=\"#remove\">How to remove unused JavaScript on WordPress?<\/a>\n<ul>\n<li><a href=\"#manually\">Fix manually<\/a><\/li>\n<li><a href=\"#plugin\">Fix automatically with a WordPress plugin<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#conclusion\">Conclusion<\/a><\/li>\n<li><a href=\"#faq\">FAQ<\/a><\/li>\n<\/ul>\n<p><\/div>\n<\/div>\n<br \/>\n<span id=\"what\"><\/span><\/p>\n<h2 style=\"margin-top: 50px;\"><span style=\"font-weight: 400;\">What is unused JavaScript and how to identify the causes?<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">As the name suggests,\u00a0 unused JavaScript consists of JS files that a webpage doesn&#8217;t use to render main elements or files that may be used later &#8211; the page can load and display the primary content without such files. Usually, it is above-the-fold content &#8211; the most important elements the viewer sees on the front page before scrolling down. However, unused JS files can be render-blocking, meaning that their presence in the code can cause the webpage to take more time to load and render the essential elements necessary for a good user experience.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><div class=\"colored-block blue_icon\">\n    <img decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/themes\/10web-blog\/images\/shortcodes\/\/blue_icon_block_icon.png\" class=\"colored-block-note\" alt=\"Note\">\n            <h4>Related Article<\/h4>\n\t        <div class=\"colored-block__content\"> <\/span><\/p>\n<ul>\n<li><a href=\"https:\/\/10web.io\/blog\/eliminate-render-blocking-resources\/\">6 Practical Tips to Eliminate Render-Blocking Resources on WordPress<\/a><\/li>\n<\/ul>\n<p><\/div>\n    <\/div>\n<\/p>\n<p><span style=\"font-weight: 400;\">Of course, not all JavaScript is render-blocking, and you need JS to add dynamic components to your website for more interactivity. However, the problem is the wrong execution time. As the web browser starts loading your web page, it parses the entire HTML before loading the page. Whenever it finds a link to a JS file or comes across inline JS &#8211; the JS code written within HTML &#8211; it stops the parsing process to fetch and execute the JS code. Naturally, the longer the JS file, the longer the execution time. And if the JS code is in a place where it is unnecessary to render the rest of the page, the rendering process will take longer for no reason.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">So, JavaScript itself is not an issue. Instead, it might be in the <strong>wrong place at the wrong time<\/strong>. For example, you can have third-party code in your HTML for analyzing your website for monitoring purposes. Tracking codes by Google Analytics and Facebook are typical sources of such third-party code. Although it is necessary for efficient website management, it is not essential for loading the main components of the page. It just comes in the way as the browser parses your page&#8217;s HTML. Similarly, you will likely add plugins to improve user experience. But such plugins also use JS and cause slow rendering.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">However, it\u2019s not always about wrong placement. You can have utterly <strong>redundant code<\/strong> that has no use in the entire website. Usually, you get \u201cdead JS\u201d if you have pieces of old code from previous web page versions that are no longer functional. Such occurrences of redundant code increase rendering time, and you should remove them immediately. Also, code for testing website performance may have JS files. Failing to remove such testing code can result in JS files piling up on your web page.\u00a0<\/span><\/p>\n<p><span id=\"identify\"><\/span><span style=\"font-weight: 400;\">You can get more detailed reports on the factors causing the &#8220;reduce unused JavaScript&#8221; message to pop up by using online testing tools to check your websites. The insights will allow you to optimize JS more effectively without compromising the website&#8217;s user-friendly elements. The following section gives three ways you can check whether your website needs improvement in terms of unused JS code.<\/span><span id=\"pagespeed\"><\/span><\/p>\n\r\n<style>\r\n  #ctablocks_inline_79{\r\n          background-color: #000000;\r\n        color: #ffffff;\r\n    border-radius: 6px;\r\n  }\r\n\r\n  #ctablocks_inline_79 p{\r\n    color: #ffffff;\r\n  }\r\n  #ctablocks_inline_79 .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_79 .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_79 .ctablocks_content_info p {\r\n        padding-left: 36px;\r\n      }\r\n      #ctablocks_inline_79 .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_79 .ctablocks_content_button {\r\n          margin-left: 37px !important;\r\n      }\r\n  }\r\n  ;\r\n<\/style>\r\n<div id=\"ctablocks_inline_79\" class=\"ctablocks_container inline_type\r\n        with_video\">\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. <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-79\" data-buttontype=\"cta-inline\"\r\n\t        >Get Started for Free<\/a>\r\n            \r\n    <\/div>\r\n  <\/div>\r\n          <div class=\"video_container\">\r\n\t                <video class=\"tenweb_video\" width=\"355\" height=\"262\"\r\n                 preload=\"metadata\" playsinline autoplay muted loop>\r\n              <source src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/04\/0003.webm\"\r\n                      data-src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/04\/0003.webm\"\r\n                      type=\"video\/webm; codecs=vp9\">\r\n          <\/video>\r\n      <\/div>\r\n  <\/div>\r\n\n<h2 style=\"margin-top: 100px;\"><span style=\"font-weight: 400;\">How to identify unused JavaScript?<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">You can check whether your website contains render-blocking JavaScript through readily available online utilities. We will explore three primary ones that are pretty well-known &#8211; PageSpeed Insights, GTMetrix, and Google Chrome&#8217;s Developer Tools &#8211; that will let you quickly understand the problem areas and help you implement the proper fixes.\u00a0<\/span><\/p>\n<h3 style=\"margin-top: 100px;\"><span style=\"font-weight: 400;\">Checking from PageSpeed Insights<\/span><\/h3>\n<p><a href=\"https:\/\/pagespeed.web.dev\/\"><span style=\"font-weight: 400;\">PageSpeed Insights<\/span><\/a><span style=\"font-weight: 400;\"> is a free online utility that helps you assess your website&#8217;s health for both desktop and mobile devices. Besides checking for unused JavaScript, it gives you a detailed report on several statistics to measure user experience and provides suggestions for improving your website&#8217;s performance through intuitive visuals. You can quickly check for unused JavaScript by following the steps below.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">1. Go to <\/span><a href=\"https:\/\/pagespeed.web.dev\/\"><span style=\"font-weight: 400;\">PageSpeed Insights<\/span><\/a><span style=\"font-weight: 400;\"> and enter your website\u2019s URL in the textbox. Click <\/span><b>Analyze.<\/b><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/image7-2-742x272.png\" alt=\"Page Speed Insights Screenshot\" width=\"742\" height=\"272\" class=\"alignnone size-medium wp-image-19992\" \/><\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/pagespeed.web.dev\/\"><span style=\"font-weight: 400; font-size: 14px;\">Image source<\/span><\/a><\/p>\n<p>2. <span style=\"font-weight: 400;\">Next, you can select <\/span><b>Desktop <\/b><span style=\"font-weight: 400;\">and scroll down to the <\/span><b>Opportunities <\/b><span style=\"font-weight: 400;\">section.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/image8-2-742x252.png\" alt=\"Desktop Opportunities Section in Page Speed Insights\" width=\"742\" height=\"252\" class=\"alignnone size-medium wp-image-19993\" srcset=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/image8-2-742x252.png 742w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/image8-2-150x51.png 150w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/image8-2-768x261.png 768w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/image8-2-600x204.png 600w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/image8-2.png 1246w\" sizes=\"auto, (max-width: 742px) 100vw, 742px\" \/><\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/pagespeed.web.dev\/\"><span style=\"font-weight: 400; font-size: 14px;\">Image source<\/span><\/a><\/p>\n<p>3. <span style=\"font-weight: 400;\">You can expand the <\/span><b>Reduce unused JavaScript<\/b><span style=\"font-weight: 400;\"> message drop-down to see the problem.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/image3-4-742x519.png\" alt=\"Expanded Reduce unused JavaScript Message Drop-down on Page Speed Insights\" width=\"742\" height=\"519\" class=\"alignnone size-medium wp-image-19994\" srcset=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/image3-4-742x519.png 742w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/image3-4-150x105.png 150w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/image3-4-768x537.png 768w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/image3-4-600x420.png 600w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/image3-4.png 1219w\" sizes=\"auto, (max-width: 742px) 100vw, 742px\" \/><\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/pagespeed.web.dev\/\"><span style=\"font-weight: 400; font-size: 14px;\">Image source<\/span><\/a><\/p>\n<p><span id=\"gtmetrix\"><\/span><span style=\"font-weight: 400;\">As you can see, WordPress plugins are the leading cause of unused JavaScript. You can also view the third-party sources for the plugins and see the estimated time savings if you reduce unused JavaScript &#8211; in this case, it is 1.03 seconds.<\/span><\/p>\n<h3 style=\"margin-top: 100px;\"><span style=\"font-weight: 400;\">Checking from GTMetrix<\/span><\/h3>\n<p><span style=\"font-weight: 400;\"><a href=\"https:\/\/gtmetrix.com\/\">GTMetrix<\/a> is another well-known free website-testing tool that gives you all the relevant statistics to assess your website&#8217;s health. It provides a detailed report on performance metrics, structure, and other vitals that help you understand where your website might need improvement. Also, the tool assigns a letter grade to your website with a summary, indicating the website&#8217;s overall performance level. You can check for unused JavaScript by following the steps mentioned below.<\/span><\/p>\n<p>1. <span style=\"font-weight: 400;\">Go to <\/span><a href=\"https:\/\/gtmetrix.com\/\"><span style=\"font-weight: 400;\">GTMetrix<\/span><\/a><span style=\"font-weight: 400;\"> and enter your website\u2019s URL. Click on the <\/span><b>Test your site <\/b><span style=\"font-weight: 400;\">button.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/image6-2-742x427.png\" alt=\"GTMetrix Screenshot\" width=\"742\" height=\"427\" class=\"alignnone size-medium wp-image-19995\" srcset=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/image6-2-742x427.png 742w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/image6-2-150x86.png 150w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/image6-2-768x442.png 768w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/image6-2-600x345.png 600w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/image6-2.png 1356w\" sizes=\"auto, (max-width: 742px) 100vw, 742px\" \/><\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/gtmetrix.com\/\"><span style=\"font-weight: 400; font-size: 14px;\">Image source<\/span><\/a><\/p>\n<p>2. <span style=\"font-weight: 400;\">After processing, GTMetrix will display the results as shown below. <\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/image1-4-742x538.png\" alt=\"Results Shown in GTMetrix \" width=\"742\" height=\"538\" class=\"alignnone size-medium wp-image-19996\" srcset=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/image1-4-742x538.png 742w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/image1-4-150x109.png 150w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/image1-4-768x556.png 768w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/image1-4-600x435.png 600w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/image1-4.png 1125w\" sizes=\"auto, (max-width: 742px) 100vw, 742px\" \/><\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/gtmetrix.com\/\"><span style=\"font-weight: 400; font-size: 14px;\">Image source<\/span><\/a><\/p>\n<p>3. <span style=\"font-weight: 400;\">Click the <\/span><b>Waterfall <\/b><span style=\"font-weight: 400;\">tab and then click <\/span><b>JS.<\/b><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/image2-3-742x485.png\" alt=\"Waterfall Chart of Unused JS in GTMetrix\" width=\"742\" height=\"485\" class=\"alignnone size-medium wp-image-19997\" srcset=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/image2-3-742x485.png 742w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/image2-3-150x98.png 150w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/image2-3-768x502.png 768w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/image2-3-600x392.png 600w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/image2-3.png 1113w\" sizes=\"auto, (max-width: 742px) 100vw, 742px\" \/><\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/gtmetrix.com\/\"><span style=\"font-weight: 400; font-size: 14px;\">Image source<\/span><\/a><\/p>\n<p><span style=\"font-weight: 400;\">The waterfall chart lists all the unused JavaScript files on your website. Hovering over the <\/span><span id=\"chrome\"><\/span><b>Timeline <\/b><span style=\"font-weight: 400;\">will show you the load time breakdown, revealing all the processes and their duration. The snapshot above shows that the execution time for the particular JS file is 44 milliseconds &#8211; called the <\/span><b>Blocking <\/b><span style=\"font-weight: 400;\">time in the chart, 50 milliseconds for the server to generate a response &#8211; called the <\/span><b>Waiting <\/b><span style=\"font-weight: 400;\">time, and six milliseconds for the browser to download the response from the server &#8211; called the <\/span><b>Receiving <\/b><span style=\"font-weight: 400;\">time.<\/span><\/p>\n<h3 style=\"margin-top: 100px;\"><span style=\"font-weight: 400;\">Using Google Chrome\u2019s Developer Tools<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">You can also check for unused JS directly using Google Chrome&#8217;s Developer tools. Go to menu items on Google Chrome &#8211; displayed as three vertical dots in the top-right corner. Click <\/span><b>More Tools<\/b><span style=\"font-weight: 400;\"> and then click <\/span><b>Developer Tools. <\/b><span style=\"font-weight: 400;\">The screenshot below shows what you&#8217;ll see for a sample WordPress website.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/image4-3-742x355.png\" alt=\"Checking unused JS directly using Google chrome's Developer tools\" width=\"742\" height=\"355\" class=\"alignnone size-medium wp-image-19998\" \/><\/p>\n<p><span style=\"font-weight: 400;\">Click <\/span><b>Coverage <\/b><span style=\"font-weight: 400;\">in the console and then click on the button as written in the console&#8217;s window. After a while, the console will list all the JS and CSS files and their corresponding usage rates in bytes. As such, you can analyze the JS files having the highest number of unused bytes and view additional details. For instance, the screenshot below shows a JS file that has 62.6% of the total bytes unused.<\/span><span id=\"ux-seo\"><\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/image5-4-742x163.png\" alt=\"Coverage in Google Chrome's Developer Tools\" width=\"742\" height=\"163\" class=\"alignnone size-medium wp-image-19999\" srcset=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/image5-4-742x163.png 742w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/image5-4-150x33.png 150w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/image5-4-768x168.png 768w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/image5-4-600x131.png 600w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/image5-4.png 1045w\" sizes=\"auto, (max-width: 742px) 100vw, 742px\" \/><\/p>\n<h2 style=\"margin-top: 100px;\"><span style=\"font-weight: 400;\">How are UX and SEO affected by unused JavaScript files?<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">So why is it so essential to reduce or <\/span><span style=\"font-weight: 400;\">remove unused JavaScript<\/span><span style=\"font-weight: 400;\">? We briefly discussed this point earlier and mentioned that unused JS files could be render-blocking. But what if they&#8217;re render blocking? Would you lose conversions if your website&#8217;s elements load slower than similar sites? Or will Google&#8217;s ranking algorithm rank your website lower than others due to slow-loading content? Answering these questions requires understanding what aspects of user experience (UX) unused JavaScript affects and whether UX is essential for website rankings on Google.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Reports suggest that you can lose almost <\/span><a href=\"https:\/\/truelist.co\/blog\/ux-statistics\/\"><span style=\"font-weight: 400;\">90% <\/span><\/a><span style=\"font-weight: 400;\">of users due to bad UX and that <\/span><a href=\"https:\/\/truelist.co\/blog\/ux-statistics\/\"><span style=\"font-weight: 400;\">for every $1 invested in UX, you get a return of $100<\/span><\/a><span style=\"font-weight: 400;\">. They also suggest that a good UX can increase conversions by <\/span><a href=\"https:\/\/truelist.co\/blog\/ux-statistics\/\"><span style=\"font-weight: 400;\">200%<\/span><\/a><span style=\"font-weight: 400;\">. The numbers should convince you that UX is critical to your business&#8217; success. Unused JS blocking or slowly rendering the website&#8217;s essential elements will likely frustrate users and cause them to abandon the site prematurely. It is particularly true in the case of e-commerce websites where users may never purchase due to suboptimal user interface (UI).\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">But poor UX is just the beginning of a more significant problem. Google&#8217;s ranking algorithm considers UX a considerable search engine optimization (SEO) factor, affecting the website&#8217;s position in the search results. After June 2021, Google updated its ranking algorithm to measure UX more holistically through a set of metrics collectively known as the Core Web Vitals. Primarily, the metrics measure three things &#8211; the time it takes to load the most prominent elements of the website, visual stability, and user interactivity. Let&#8217;s understand the metrics in more detail to get a better perspective.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The metric measuring the loading time of a website&#8217;s primary content is known more formally as the <\/span><span style=\"font-weight: 400;\">Largest Contentful Paint<\/span><span style=\"font-weight: 400;\"> (LCP). Suppose you have an e-commerce website that sells clothing items. You are likely to feature a fashion model&#8217;s image as the primary visual content on the website to display a particular clothing item. LCP will measure how long the website takes to load the featured image completely, as it is the primary element of the page. Google considers an LCP of less than 2.5 seconds good, while anything more than 4 seconds is considered poor.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/08\/largest-contentful-paint-scores.png\" alt=\"largest contentful paint scores\" width=\"742\" height=\"416\" class=\"alignnone size-full wp-image-18712\" srcset=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/08\/largest-contentful-paint-scores.png 742w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/08\/largest-contentful-paint-scores-150x84.png 150w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/08\/largest-contentful-paint-scores-371x208.png 371w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2022\/08\/largest-contentful-paint-scores-600x336.png 600w\" sizes=\"auto, (max-width: 742px) 100vw, 742px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">In contrast, <\/span><a href=\"https:\/\/10web.io\/site-speed-glossary\/cumulative-layout-shift\/\"><span style=\"font-weight: 400;\">Cumulative Layout Shift (CLS)<\/span><\/a><span style=\"font-weight: 400;\"> measures the content&#8217;s stability on the webpage as it loads, meaning how much the content shifts from one place to another. For example, you can experience unstable content when you try to click the checkout option on an e-commerce website, but you can&#8217;t do it because the content shifts down. The higher the instability, the higher the CLS score, indicating a poor user experience. Google measures CLS by multiplying the impact fraction and the distance fraction &#8211; the impact fraction measures the size of the element that shifts relative to the viewport, and the distance fraction measures how far the element moves relative to the viewport. A viewport is a user&#8217;s viewing area.\u00a0<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/01\/3-1-768x431-1-742x416.jpg\" alt=\"Cumulative layout shift\" width=\"742\" height=\"416\" class=\"alignnone size-medium wp-image-19535\" srcset=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/01\/3-1-768x431-1-742x416.jpg 742w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/01\/3-1-768x431-1-150x84.jpg 150w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/01\/3-1-768x431-1-371x208.jpg 371w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/01\/3-1-768x431-1-600x337.jpg 600w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/01\/3-1-768x431-1.jpg 768w\" sizes=\"auto, (max-width: 742px) 100vw, 742px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">Finally, we have the <\/span><a href=\"https:\/\/10web.io\/site-speed-glossary\/first-input-delay\/\"><span style=\"font-weight: 400;\">First Input Delay (FID)<\/span><\/a><span style=\"font-weight: 400;\"> measure, which measures interactivity by calculating how long a website takes to respond to a user&#8217;s input. For example, FID would measure the time it takes for a website to expand a drop-down menu after you click on it. The longer the website responds to your click, the higher the FID will be, suggesting a poor user experience. Since measuring FID requires live users, checking it through the tools mentioned above is complex. As such, the tools often use Total Blocking Time (TBT) as a proxy for measuring FID. TBT is the difference between LCP and Time to Interactive (TTI) &#8211; the time it takes for the website to be ready for the user to interact. Since LCP is a website&#8217;s time to load the primary content, TBT measures the time a website takes to allow users to interact after loading all the essential components. During this time, the browser blocks the website from the users.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/01\/2-1-768x431-1-742x416.jpg\" alt=\"First input delay\" width=\"742\" height=\"416\" class=\"alignnone size-medium wp-image-19534\" srcset=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/01\/2-1-768x431-1-742x416.jpg 742w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/01\/2-1-768x431-1-150x84.jpg 150w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/01\/2-1-768x431-1-371x208.jpg 371w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/01\/2-1-768x431-1-600x337.jpg 600w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/01\/2-1-768x431-1.jpg 768w\" sizes=\"auto, (max-width: 742px) 100vw, 742px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">JavaScript mainly concerns the <strong>FID<\/strong> score since JS components comprise most of a website&#8217;s interactive elements. Also, as discussed earlier, since unused JS delays the parsing process, it can delay loading the items necessary to make the page ready for users to interact. As such, FID can increase if there&#8217;s a lot of unused JS in the code, reducing the overall UX score and thus affecting the site&#8217;s ranking. Lighthouse &#8211; an open-source website testing tool available in Google chrome&#8217;s Developer Tools &#8211; gives <\/span><span id=\"remove\"><\/span><a href=\"https:\/\/github.com\/GoogleChrome\/lighthouse\/blob\/main\/docs\/v8-perf-faq.md\"><span style=\"font-weight: 400;\">30%<\/span><\/a><span style=\"font-weight: 400;\"> weightage to TBT, the highest of all other UX measures. Since TBT is a proxy for FID, it is evident how significant user interactivity is for your website&#8217;s performance and ranking. A TBT score of fewer than 300 milliseconds is considered good.<\/span><\/p>\n<h2 style=\"margin-top: 100px;\"><span style=\"font-weight: 400;\">How to remove unused JavaScript on WordPress?<\/span><\/h2>\n<p><span id=\"manually\"><\/span><span style=\"font-weight: 400;\">Now that we know what unused JavaScript is, how to check it, and why it&#8217;s essential to reduce or <\/span><span style=\"font-weight: 400;\">remove unused JavaScript<\/span><span style=\"font-weight: 400;\">, let&#8217;s discuss some ways to help you achieve it. Several manual fixes exist that can quickly help upgrade your website&#8217;s performance. We&#8217;ve already touched upon a few, such as removing third-party plugins and optimizing HTML to ensure JS links don&#8217;t come in the way of parsing. However, you can also <\/span><span style=\"font-weight: 400;\">remove unused JavaScript automatically<\/span><span style=\"font-weight: 400;\"> through several tools designed to boost your website&#8217;s <strong>Core Web Vitals<\/strong>. So, let&#8217;s start with the manual fixes and then move to automated solutions.<\/span><\/p>\n<h3 style=\"margin-top: 100px;\"><span style=\"font-weight: 400;\">Fix manually<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">Some common fixes you can apply to<\/span><span style=\"font-weight: 400;\"> remove unused JavaScript<\/span><span style=\"font-weight: 400;\"> manually involve using minimal themes, fewer plugins and third-party code, and avoiding page-builder plugins. Let&#8217;s look at these in more detail.<\/span><\/p>\n<ul>\n<li><b>Using lightweight themes and builder plugins: <\/b><span style=\"font-weight: 400;\">A straightforward way to reduce unused JavaScript is to apply lightweight themes to your webpage. Using page builders like Elementor and Divi can bloat your website due to heavy frontend with many JS files.<\/span><\/li>\n<li><b>Fewer plugins and third-party code: <\/b><span style=\"font-weight: 400;\">JS plugins cause additional JavaScript to accumulate on your webpage. Such plugins usually enhance a page&#8217;s design by including sliders, galleries, forms, buttons, etc. Also, third-party codes such as Google and Facebook Ad trackers can slow down the page-loading process. The solution is to use only the relevant plugins, smaller tracking codes (you can search &#8220;<\/span><span style=\"font-weight: 400;\">reduce unused JavaScript Google Tag Manager<\/span><span style=\"font-weight: 400;\">&#8221; to get suggestions), and host third-party code on local servers instead of loading it through external links. In addition, avoid loading third-party code during above-the-fold content (content that the user sees first when a page loads). You can do so by optimizing the placement of JS code so that it doesn&#8217;t appear when the browser parses above-the-fold content.<\/span><\/li>\n<li><b>Remove heavy JavaScript files: <\/b><span style=\"font-weight: 400;\">You can find heavy JavaScript files with usage rates through Google Chrome&#8217;s Developer tools. You can remove the ones with the least usage rates after ensuring that above-the-fold content doesn&#8217;t require it.<\/span><\/li>\n<li><b>Delay loading JavaScript: <\/b><span style=\"font-weight: 400;\">You can also use plugins to delay JavaScript loading, meaning that no JS file will become active until the user interacts. The technique improves server response time and ensures you don&#8217;t get the &#8220;reduce unused javascript&#8221; message on website checking tools. It works well with heavy Youtube and Facebook files, in which case you get errors like <\/span><span style=\"font-weight: 400;\">\u201creduce unused javascript facebook\u201d<\/span><span style=\"font-weight: 400;\"> or <\/span><span style=\"font-weight: 400;\">\u201cremove unused javascript youtube\u201d<\/span><span style=\"font-weight: 400;\">. With Youtube, it\u2019s commonly the Base.js file that appears when you use Youtube player\u2019s iframe API. For Facebook, it\u2019s usually Facebook chat plugins and tracking codes.<\/span><\/li>\n<\/ul>\n<h3 style=\"margin-top: 100px;\"><span style=\"font-weight: 400;\">Fix automatically with a WordPress plugin<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">A quicker way of applying the above fixes is through a <\/span><span style=\"font-weight: 400;\">WordPress plugin to remove unused JavaScript<\/span><span style=\"font-weight: 400;\">. The plugin can help you <\/span><span style=\"font-weight: 400;\">remove unused JavaScript<\/span><span style=\"font-weight: 400;\"> automatically to save time and effort. <\/span><a href=\"https:\/\/10web.io\/page-speed-booster\/\"><span style=\"font-weight: 400;\">10Web Booster<\/span><\/a><span style=\"font-weight: 400;\"> is a plugin with several features to boost your website&#8217;s Core Web Vitals and ensure your visitors get a perfect user experience. The plugin can easily delay loading <\/span><span style=\"font-weight: 400;\">JavaScript<\/span><span style=\"font-weight: 400;\"> scripts to allow the page to load faster and reduce FID to boost your site&#8217;s ranking on Google&#8217;s search engine. The whole experience is automated and works out-of-the-box. JS delay technique is available in both free and pro versions of the plugin. You can download and use 10Web Booster for free from <\/span><a href=\"https:\/\/wordpress.org\/plugins\/tenweb-speed-optimizer\/\"><span style=\"font-weight: 400;\">wordpress.org<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/p>\n<div class=\"youtube_embed without_rel\" data-id=\"oX1FEYIA5xQ\">\n<div id=\"video1\"><\/div>\n<\/div>\n<p><span style=\"font-weight: 400;\">10Web Booster can do more than help <\/span><span style=\"font-weight: 400;\">remove unused JavaScript<\/span><span id=\"conclusion\"><\/span><span style=\"font-weight: 400;\"> from your websites. It\u2019s a complete solution to boost your website\u2019s performance through state-of-the-art optimization <\/span><a href=\"https:\/\/10web.io\/page-speed-booster\/\"><span style=\"font-weight: 400;\">features<\/span><\/a><span style=\"font-weight: 400;\"> that ensure a <strong>PageSpeed score of 90+<\/strong>. As a killer feature, it includes a robust content delivery network (CDN) built upon Cloudflare\u2019s extensive network spanning <strong>275 cities across the globe<\/strong>. And combined with full-page caching, 10Web Booster reduces server response time and allows users to interact seamlessly with your website.\u00a0<\/span><\/p>\n<h2 style=\"margin-top: 100px;\"><span style=\"font-weight: 400;\">Conclusion<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">You&#8217;ll likely get hundreds of results if you search for articles on the unused JavaScript topic, indicating how significant it is to <\/span><span style=\"font-weight: 400;\">remove unused Javascript <\/span><span style=\"font-weight: 400;\">to improve website performance. However, as discussed earlier, the culprits are mainly external JS links or third-party tracking codes that appear as the browser parses HTML to deliver above-the-fold content. <span id=\"faq\"><\/span>But heavy plugins with excessive JS can also cause the issue. Although JS plugins make your webpage pretty and interactive, too many can backfire and adversely affect your business by lowering conversions. With 10Web Booster, you can quickly identify such files and plugins causing issues and let 10Web <\/span><span style=\"font-weight: 400;\">remove unused JavaScript<\/span><span style=\"font-weight: 400;\"> for you.\u00a0<\/span><\/p>\n\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\n<h2 style=\"margin-top: 100px;\"><span style=\"font-weight: 400;\">FAQ<\/span><\/h2>\n<div class=\"faq-shortcode\">\n    <p class=\"faq_title\">How to detect unused JavaScript?<\/p>\n    <div class=\"faq_content\"> You can quickly detect unused JavaScript using open-source tools like PageSpeed Insights, GTMetrix, and Google Chrome&#8217;s Developer tools. PageSpeed Insights will show the &#8220;reduce unused JavaScript&#8221; message in the Opportunities section and provide the sources causing the message to pop up. In GTMetrix, you can view the waterfall chart to see all unused JS files and a load time breakdown to understand better which ones are causing the most delay. You can use Google Chrome&#8217;s Dev tools to get a more detailed view of each file&#8217;s usage rates and decide which ones you should remove. <\/div>\n<\/div>\n\n<div class=\"faq-shortcode\">\n    <p class=\"faq_title\">How to optimize third-party JS code?<\/p>\n    <div class=\"faq_content\"> Instead of fetching third-party code from external servers, hosting the scripts on your local server is more manageable, so it takes less time to download and execute the scripts. You can also delay loading JS files until the user interacts through a plugin like 10Web Booster. <\/div>\n<\/div>\n\n<div class=\"faq-shortcode\">\n    <p class=\"faq_title\">How to reduce unused JavaScript on Elementor?<\/p>\n    <div class=\"faq_content\"> You can use 10Web Booster to delay JS on Elementor sites automatically. Alternatively, In Elementor, you can go to Elementor and then go to Settings. Under Experiments, you can set the Improved Asset Loading tag to Active. The setting will ensure that widgets load their handlers only when used. Also, with Improved Asset Loading set to Active, the Swiper JS library &#8211; a mobile touch slider &#8211; will only load if a webpage contains at least one element that needs the library. If no such element exists, the library will not load. The functionality is available in Elementor v3.1.0 or later. <\/div>\n<\/div>\n\n<div class=\"faq-shortcode\">\n    <p class=\"faq_title\">What are the best practices to avoid unused JS?<\/p>\n    <div class=\"faq_content\">\n<p><span style=\"font-weight: 400;\">Best practices to avoid unused JavaScript include:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Load JS later, after the main content of the page is rendered<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Using simple themes with less unnecessary animations, interactivity or effects.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Using minimal third-party codes and plugins<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Minifying JavaScript<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Using shorter and less tracking codes <\/span><\/div>\n<\/div>\n<\/li>\n<\/ul>\n<p>\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>\ufeff If you&#8217;re someone managing a website, you&#8217;ll likely be familiar with the &#8220;reduce unused JavaScript&#8221; message that pops up on a website checking tool whenever you have some irrelevant JavaScript code on specific web pages. For instance, you may have seen the message when you checked your website through PageSpeed Insights &#8211; an online website testing tool &#8211; and&#8230;<\/p>\n","protected":false},"author":79,"featured_media":19988,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"two_page_speed":[],"footnotes":"","tenweb_blog_toc":"<ul><li><a href=\"#what-is-unused-javascript-and-how-to-identify-the-causes\">What is unused JavaScript and how to identify the causes?<\/a><li><a href=\"#how-to-identify-unused-javascript\">How to identify unused JavaScript?<\/a><ul><li><a href=\"#checking-from-pagespeed-insights\">Checking from PageSpeed Insights<\/a><li><a href=\"#checking-from-gtmetrix\">Checking from GTMetrix<\/a><li><a href=\"#using-google-chromes-developer-tools\">Using Google Chrome\u2019s Developer Tools<\/a><\/li><\/ul><li><a href=\"#how-are-ux-and-seo-affected-by-unused-javascript-files\">How are UX and SEO affected by unused JavaScript files?<\/a><li><a href=\"#how-to-remove-unused-javascript-on-wordpress\">How to remove unused JavaScript on WordPress?<\/a><ul><li><a href=\"#fix-manually\">Fix manually<\/a><li><a href=\"#fix-automatically-with-a-wordpress-plugin\">Fix automatically with a WordPress plugin<\/a><\/li><\/ul><li><a href=\"#conclusion\">Conclusion<\/a><li><a href=\"#faq\">FAQ<\/a><\/li><\/ul>","tenweb_blog_competitor_type":"","tenweb_blog_competitor_names":"","tenweb_blog_twb_version":0,"tenweb_blog_type":"on"},"categories":[465],"tags":[203,439],"class_list":["post-19987","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-speed","tag-website-speed","tag-wordpress"],"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 Detect and Remove Unused Javascript in 2023 - 10Web<\/title>\n<meta name=\"description\" content=\"To quickly improve your WordPress website&#039;s performance and loading speed, you must know how to remove unused JavaScript automatically.\" \/>\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\/remove-unused-javascript\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Remove Unused JavaScript on WordPress Automatically\" \/>\n<meta property=\"og:description\" content=\"To quickly improve your WordPress website&#039;s performance and loading speed, you must know how to remove unused JavaScript automatically.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/10web.io\/blog\/remove-unused-javascript\/\" \/>\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=\"2023-02-20T12:17:14+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-02-22T12:48:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/Remove-unused-JavaScript.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=\"Arto Minasyan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@artavazdm\" \/>\n<meta name=\"twitter:site\" content=\"@10Web_io\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Arto Minasyan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"17 minutes\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Detect and Remove Unused Javascript in 2023 - 10Web","description":"To quickly improve your WordPress website's performance and loading speed, you must know how to remove unused JavaScript automatically.","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\/remove-unused-javascript\/","og_locale":"en_US","og_type":"article","og_title":"How to Remove Unused JavaScript on WordPress Automatically","og_description":"To quickly improve your WordPress website's performance and loading speed, you must know how to remove unused JavaScript automatically.","og_url":"https:\/\/10web.io\/blog\/remove-unused-javascript\/","og_site_name":"10Web - Build &amp; Host Your WordPress Website","article_publisher":"https:\/\/www.facebook.com\/10Web.io\/","article_published_time":"2023-02-20T12:17:14+00:00","article_modified_time":"2026-02-22T12:48:43+00:00","og_image":[{"width":1484,"height":832,"url":"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/Remove-unused-JavaScript.png","type":"image\/png"}],"author":"Arto Minasyan","twitter_card":"summary_large_image","twitter_creator":"@artavazdm","twitter_site":"@10Web_io","twitter_misc":{"Written by":"Arto Minasyan","Est. reading time":"17 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/10web.io\/blog\/remove-unused-javascript\/#article","isPartOf":{"@id":"https:\/\/10web.io\/blog\/remove-unused-javascript\/"},"author":{"name":"Arto Minasyan","@id":"https:\/\/10web.io\/blog\/#\/schema\/person\/b2a531cd7f3eb7353f839f77c203007e"},"headline":"How to Remove Unused JavaScript on WordPress Automatically","datePublished":"2023-02-20T12:17:14+00:00","dateModified":"2026-02-22T12:48:43+00:00","mainEntityOfPage":{"@id":"https:\/\/10web.io\/blog\/remove-unused-javascript\/"},"wordCount":3215,"commentCount":2,"publisher":{"@id":"https:\/\/10web.io\/blog\/#organization"},"image":{"@id":"https:\/\/10web.io\/blog\/remove-unused-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/Remove-unused-JavaScript.png","keywords":["website speed","wordpress"],"articleSection":["Page Speed"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/10web.io\/blog\/remove-unused-javascript\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/10web.io\/blog\/remove-unused-javascript\/","url":"https:\/\/10web.io\/blog\/remove-unused-javascript\/","name":"How to Detect and Remove Unused Javascript in 2023 - 10Web","isPartOf":{"@id":"https:\/\/10web.io\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/10web.io\/blog\/remove-unused-javascript\/#primaryimage"},"image":{"@id":"https:\/\/10web.io\/blog\/remove-unused-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/Remove-unused-JavaScript.png","datePublished":"2023-02-20T12:17:14+00:00","dateModified":"2026-02-22T12:48:43+00:00","description":"To quickly improve your WordPress website's performance and loading speed, you must know how to remove unused JavaScript automatically.","breadcrumb":{"@id":"https:\/\/10web.io\/blog\/remove-unused-javascript\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/10web.io\/blog\/remove-unused-javascript\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/10web.io\/blog\/remove-unused-javascript\/#primaryimage","url":"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/Remove-unused-JavaScript.png","contentUrl":"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/02\/Remove-unused-JavaScript.png","width":1484,"height":832,"caption":"Remove Unused JavaScript on WordPress"},{"@type":"BreadcrumbList","@id":"https:\/\/10web.io\/blog\/remove-unused-javascript\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/10web.io\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Remove Unused JavaScript on WordPress Automatically"}]},{"@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\/b2a531cd7f3eb7353f839f77c203007e","name":"Arto Minasyan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/10web.io\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/9b1112aab2e31af3c41be33bdfc49a63?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9b1112aab2e31af3c41be33bdfc49a63?s=96&d=mm&r=g","caption":"Arto Minasyan"},"description":"Arto Minasyan is the Co-Founder and President at 10Web and Krisp, two companies revolutionizing web development and audio communications. Arto has over 10 years of experience building and leading cutting-edge teams and products in the tech industry. His passion for AI, machine learning, and entrepreneurship drives the success of the projects he leads.","sameAs":["https:\/\/10web.io\/","https:\/\/www.linkedin.com\/in\/artominasyan\/","https:\/\/x.com\/artavazdm"],"honorificSuffix":"PhD","knowsAbout":["Artificial Intelligence","Machine Learning","Web Development","Entrepreneurship","WordPress","WooCommerce","Startup Funding","SaaS Development","Physics & Mathematics"],"jobTitle":"Co-Founder & President","worksFor":"Arto Minasyan","url":"https:\/\/10web.io\/blog\/author\/arto\/"}]}},"acf":[],"_links":{"self":[{"href":"https:\/\/10web.io\/blog\/wp-json\/wp\/v2\/posts\/19987","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\/79"}],"replies":[{"embeddable":true,"href":"https:\/\/10web.io\/blog\/wp-json\/wp\/v2\/comments?post=19987"}],"version-history":[{"count":0,"href":"https:\/\/10web.io\/blog\/wp-json\/wp\/v2\/posts\/19987\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/10web.io\/blog\/wp-json\/wp\/v2\/media\/19988"}],"wp:attachment":[{"href":"https:\/\/10web.io\/blog\/wp-json\/wp\/v2\/media?parent=19987"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/10web.io\/blog\/wp-json\/wp\/v2\/categories?post=19987"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/10web.io\/blog\/wp-json\/wp\/v2\/tags?post=19987"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}