{"id":3300520,"date":"2021-04-21T14:56:31","date_gmt":"2021-04-21T12:56:31","guid":{"rendered":"https:\/\/wp-rocket.me\/?post_type=core_web_vitals_hub&#038;p=3300520"},"modified":"2024-06-24T12:46:08","modified_gmt":"2024-06-24T10:46:08","slug":"remove-unused-javascript","status":"publish","type":"core_web_vitals_hub","link":"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/remove-unused-javascript\/","title":{"rendered":"How to Remove Unused JavaScript Files on WordPress"},"content":{"rendered":"<p>\u201cRemove unused Javascript\u201d (or the latest: &#8220;<strong>Reduce<\/strong> unused Javascript&#8221;) is one of the most daunting PageSpeed Insights recommendations you can come across when <a href=\"https:\/\/wp-rocket.me\/blog\/how-to-test-wordpress-site-performance-measure-speed-results\/\">testing your WordPress site performance<\/a>. It\u2019s also one of the most common, so you likely saw it in your performance report.<\/p><p>Let\u2019s understand what unused JavaScript files mean and and what the impact of JavaScript code is on performance. You\u2019ll learn how you can remove or reduce them and improve your WordPress performance.<\/p><p>Watch our video first, or just keep reading our article!<\/p><figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe title=\"How to Reduce Unused JavaScript\" width=\"720\" height=\"405\" src=\"https:\/\/www.youtube.com\/embed\/yU2wMuHYxOo?feature=oembed&#038;enablejsapi=1&#038;origin=https:\/\/wp-rocket.me\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen><\/iframe>\n<\/div><\/figure><h2 class=\"wp-block-heading\">What are Unused JavaScript Files?<\/h2><p>Unused JavaScript code is about files that are not needed for rendering the page \u2014 that is, to load and display the main content of the page.\u00a0<\/p><p>They may not be needed for two reasons:<\/p><ol class=\"wp-block-list\"><li><strong>They\u2019re not part of the above-the-fold content <\/strong>\u2014 the most important content that needs to be rendered.<br>To load the page faster, the browser should analyze and render only the essential resources&nbsp; &#8211; mainly HTML code. On a side note, that\u2019s also why <a href=\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/eliminate-render-blocking-javascript-css\/\">you should eliminate the JS and CSS render-blocking resources<\/a> that slow down the page\u2019s loading.<br><br>A typical example of such JS files is third-party code, such as Google Analytics and Facebook tracking codes.<br><br>Another helpful example for WordPress users is using plugins only when needed. All plugins load scripts that are mainly based on JS. That\u2019s why you should be careful and load them only on the essential pages. Otherwise, the impact of the JavaScript files will be heavy on performance, and there won\u2019t be another easy way to fix the issue. The same goes for themes and page builders that heavily rely on JavaScript.<\/li><\/ol><ol class=\"wp-block-list\" start=\"2\"><li><strong>They\u2019re in the code, but they\u2019re not used anymore<\/strong>. They\u2019re completely useless.&nbsp;<\/li><\/ol><h2 class=\"wp-block-heading\">Why You Should Remove Unused JavaScript\u00a0on WordPress<\/h2><p>The WordPress unused JavaScript files can hugely affect your site\u2019s performance and user experience. The main metric involved is the First Input Delay (FID), one of the <a href=\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/\">Core Web Vitals metrics<\/a>.\u00a0<\/p><p><a href=\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/improve-first-input-delay\/\">The First Input Delay<\/a> measures a page\u2019s responsiveness by taking into account the user interaction \u2014 therefore, it can only be calculated on the field.<\/p><p><a href=\"https:\/\/wp-rocket.me\/lighthouse-performance-score-wordpress\/reduce-total-blocking-time\/\">Total Blocking Time (TBT)<\/a> replaces FID as the Lighthouse metric determining the page\u2019s interactivity based on user input. TBT metric accounts for 25% of the Lighthouse performance score. It\u2019s easy to see how important it is and why removing unused JavaScript code is essential.<\/p><p>As we explained, unused JavaScript can affect how fast the browser renders and loads the page. And a worse page loading time is no good for users, too.<\/p><figure class=\"wp-block-table\"><table><tbody><tr><td>\ud83d\ude80 Want to know more about Lighthouse? Read our article on <a href=\"https:\/\/wp-rocket.me\/lighthouse-performance-score-wordpress\/\">how to improve your Lighthouse&nbsp;performance score<\/a>!<\/td><\/tr><\/tbody><\/table><\/figure><h2 class=\"wp-block-heading\">How to Find the Unused JS to Eliminate or Reduce<\/h2><p>There are different ways to analyze and identify the JavaScript files you should take care of.<\/p><p>Let\u2019s go over two easy and straightforward tools: PageSpeed Insights and GTmetrix.<\/p><h3 class=\"wp-block-heading\">Finding Unused JS via PageSpeed Insights<\/h3><p>The PageSpeed Insights report makes it very easy to identify the unused JavaScript you should eliminate. Go to the Opportunities section and look for \u201cRemove unused JavaScript\u201d. Here, you\u2019ll find if and what JS resources are affecting your site\u2019s performance. In the example below, the JS script is related to Google Tag Manager.<\/p><figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1148\" height=\"862\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2021\/06\/reduce-unused-js.png\" alt=\"Remove unused JavaScript - PSI\" class=\"wp-image-3459452\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2021\/06\/reduce-unused-js.png 1148w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2021\/06\/reduce-unused-js-260x195.png 260w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2021\/06\/reduce-unused-js-768x577.png 768w\" sizes=\"(max-width: 1148px) 100vw, 1148px\" \/><\/figure><h3 class=\"wp-block-heading\">Finding Unused JS via GTmetrix<\/h3><p>Another way to find the JavaScript files is through the Waterfall Chart provided by GTmetrix. After testing your URL\u2019s performance, go to the Waterfall Chart and look at the JS tab. There, you\u2019ll find the list of unused JS you should manage.<\/p><p>As we mentioned above, most heavy JS scripts are related to tracking codes (e.g., Google Tag Manager) and plugins. You can easily understand it by looking at the Domain column.<\/p><figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1335\" height=\"598\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2021\/04\/waterfall-chart-gtmetrix.png\" alt=\"GTmetrix waterfall\" class=\"wp-image-3300538\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2021\/04\/waterfall-chart-gtmetrix.png 1335w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2021\/04\/waterfall-chart-gtmetrix-310x139.png 310w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2021\/04\/waterfall-chart-gtmetrix-768x344.png 768w\" sizes=\"(max-width: 1335px) 100vw, 1335px\" \/><figcaption class=\"wp-element-caption\">GTmetrix waterfall<\/figcaption><\/figure><p>Let\u2019s now understand how to address the PSI recommendation and tackle the unused JavaScript.<\/p><h2 class=\"wp-block-heading\">How to Remove Unused JS Files on WordPress: Two Methods<\/h2><p>You can remove or reduce unused JS files in two ways:<\/p><ol class=\"wp-block-list\"><li><strong>You can <a href=\"#delay-js\">delay JavaScript resources<\/a><\/strong>. By doing so, the JavaScript files will be loaded only when there\u2019s user interaction, such as scrolling or tapping on a button. If no user interaction takes place, the JS files won\u2019t be loaded at all.&nbsp;<br><br>Please note that not all the scripts from the PageSpeed recommendation list can be safely delayed. You should only delay the JS files that are above the fold because they\u2019re render-blocking resources.<br><br>If you delay JavaScript, the Lighthouse tool won\u2019t detect any JS files since they have not been loaded yet. Here\u2019s how you can address the PSI recommendation and ensure that the vast majority of files won\u2019t be included in the report.<\/li><\/ol><ol class=\"wp-block-list\" start=\"2\"><li><strong>You can load the JavaScript files only when needed.<\/strong> It means that the JS scripts will be executed only if and when certain pages need them. Once again, you can think about the plugins and specific themes or page builders that you use \u2014 it&#8217;s likely they are not helpful on all pages.<\/li><\/ol><p>The two options are complementary as each method tackles a different aspect of managing unused JS.<\/p><p>On the one hand, delaying JS will control when the code is executed. It&#8217;s technically a workaround rather than a fix. But it has its effect since it&#8217;s making JS non-render-blocking.<br><br>On the other hand, unloading unnecessary assets will reduce the size of JS on the page. It&#8217;s technically reducing unused JS rather than totally removing it.<\/p><p><strong>Note:<\/strong> even using such methods, it&#8217;s hard to get rid of the PageSpeed Insights notification. Lighthouse flags any file with more than 20kb of unused JS code.&nbsp;<\/p><p>Since most themes and plugins come with bundled JS files, it&#8217;s very likely the above limit will be exceeded in many files. In other words, combining JS will almost guarantee that you will always get the recommendation showing.&nbsp;<\/p><p><strong>That\u2019s why in most cases, the ultimate goal is to reduce the effect of removing unused JS rather than completely fixing it.&nbsp;<\/strong><\/p><p>A good example is the jQuery library when it can&#8217;t be delayed. It will always be flagged for unused JS.&nbsp;<\/p><h2 class=\"wp-block-heading\">Removing Unused JS Resources with Plugins<\/h2><p>You have different options to remove or reduce unused JavaScript by using plugins.<\/p><p id=\"delay-js\"><strong>If you want to delay the JavaScript files,<\/strong> you can use the Delay JavaScript Execution feature provided by WP Rocket.&nbsp;<\/p><p>The option is straightforward to use and will help you save tons of time and effort!<\/p><p>In the File Optimization tab, go to the Delay JavaScript Execution option and flag it. You don\u2019t have literally to do anything else.&nbsp;<\/p><p>WP Rocket will take care of everything, and you\u2019ll see an evident difference in your performance score and the PSI report.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"991\" height=\"458\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2021\/11\/delay-js-execution-3-9-2.png\" alt=\"Delay JavaScript Execution tab - WP Rocket\" class=\"wp-image-3873980\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2021\/11\/delay-js-execution-3-9-2.png 991w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2021\/11\/delay-js-execution-3-9-2-310x143.png 310w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2021\/11\/delay-js-execution-3-9-2-768x355.png 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2021\/11\/delay-js-execution-3-9-2-130x60.png 130w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2021\/11\/delay-js-execution-3-9-2-195x90.png 195w\" sizes=\"(max-width: 991px) 100vw, 991px\" \/><\/figure><p><br><a href=\"https:\/\/wp-rocket.me\/features\/\">Get WP Rocket now and test the improvements right away!<\/a><\/p><p>Another way to delay JS files is to use a plugin such as <a href=\"https:\/\/wordpress.org\/plugins\/flying-scripts\/\">Flying Scripts<\/a> or <a href=\"https:\/\/wordpress.org\/plugins\/wp-meteor\/\">WP Meteor<\/a>.&nbsp;<\/p><p>On the other hand, you can use an asset manager plugin <strong>to control where specific files will be loaded<\/strong>, such as:&nbsp;<\/p><ul class=\"wp-block-list\"><li><a href=\"https:\/\/wordpress.org\/plugins\/wp-asset-clean-up\/\">Asset CleanUp<\/a><\/li>\n\n<li><a href=\"https:\/\/perfmatters.io\/\">Permatters<\/a><\/li>\n\n<li><a href=\"https:\/\/gonzalesplugin.com\/\">Gonzales<\/a><\/li>\n\n<li><a href=\"https:\/\/wordpress.org\/plugins\/plugin-organizer\/\">Plugin Organizer<\/a>.<\/li><\/ul><p><\/p><div id=\"om-nyrydv5iync8zrrulm5i-holder\"><\/div>\n\t<script>(function (d, u, ac) {\n\t\t\tvar s = d.createElement('script')\n\t\t\ts.type = 'text\/javascript'\n\t\t\ts.src = 'https:\/\/a.omappapi.com\/app\/js\/api.min.js'\n\t\t\ts.async = true\n\t\t\ts.dataset.user = u\n\t\t\ts.dataset.campaign = ac\n\t\t\td.getElementsByTagName('head')[0].appendChild(s)\n\t\t})(document, 20440, 'nyrydv5iync8zrrulm5i')<\/script><h2 class=\"wp-block-heading\">Start Removing Unused JavaScript Right Now<\/h2><p>Removing or reducing unused JavaScript is an essential step for optimizing the FID grade and improve your site performance \u2014 and even <a href=\"https:\/\/wp-rocket.me\/blog\/how-to-score-100-google-page-speed-test\/\">score 100% on Google PageSpeed Insights<\/a>!<\/p><p>Thanks to WP Rocket, you can easily manage unused JS and tackle the performance issue.&nbsp;<\/p><p>Not a WP Rocket customer yet? <a href=\"https:\/\/wp-rocket.me\/features\/\">Save yourself time and let WP Rocket do the job for you. WP Rocket is the easiest way to improve your PageSpeed Insights score<\/a>.&nbsp;<\/p><p><strong>You can always count on our 100% money-back guarantee<\/strong>. Although we don\u2019t think you\u2019ll ever want one, we\u2019ll gladly provide a refund if you request it within 14 days of purchase. <\/p><p>\ud83d\ude80<strong> The only risk you\u2019ll be taking with our plugin is speeding up your website. <\/strong>WP Rocket automatically applies 80% of web performance best practices, instantly boosting your Core Web Vitals scores.&nbsp;<\/p>","protected":false},"excerpt":{"rendered":"<p>Wondering how to remove the unused JavaScript files on WordPress to improve the Core Web Vitals performance and your PageSpeed Insights score? Keep reading, and you\u2019ll find all the information you need!<\/p>\n","protected":false},"template":"","core_web_vitals":[159],"class_list":["post-3300520","core_web_vitals_hub","type-core_web_vitals_hub","status-publish","hentry","core_web_vitals-improve-interaction-to-next-paint"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Remove Unused JavaScript on WordPress<\/title>\n<meta name=\"description\" content=\"Want to understand how to remove unused JavaScript on WordPress and improve your PageSpeed Insights score? Find out all the information you need on WP Rocket!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/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\" \/>\n<meta property=\"og:description\" content=\"Want to understand how to remove unused JavaScript on WordPress and improve your PageSpeed Insights score? Find out all the information you need on WP Rocket!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/remove-unused-javascript\/\" \/>\n<meta property=\"og:site_name\" content=\"WP Rocket\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/pages\/WP-Rocket\/631942253526829\" \/>\n<meta property=\"article:modified_time\" content=\"2024-06-24T10:46:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2021\/06\/reduce-unused-js.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@wp_rocket\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/remove-unused-javascript\/\",\"url\":\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/remove-unused-javascript\/\",\"name\":\"How to Remove Unused JavaScript on WordPress\",\"isPartOf\":{\"@id\":\"https:\/\/wp-rocket.me\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/remove-unused-javascript\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/remove-unused-javascript\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2021\/06\/reduce-unused-js.png\",\"datePublished\":\"2021-04-21T12:56:31+00:00\",\"dateModified\":\"2024-06-24T10:46:08+00:00\",\"description\":\"Want to understand how to remove unused JavaScript on WordPress and improve your PageSpeed Insights score? Find out all the information you need on WP Rocket!\",\"breadcrumb\":{\"@id\":\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/remove-unused-javascript\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/remove-unused-javascript\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/remove-unused-javascript\/#primaryimage\",\"url\":\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2021\/06\/reduce-unused-js.png\",\"contentUrl\":\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2021\/06\/reduce-unused-js.png\",\"width\":1148,\"height\":862},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/remove-unused-javascript\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/wp-rocket.me\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Core Web Vitals\",\"item\":\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Interaction to Next Paint\",\"item\":\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/improve-interaction-to-next-paint\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"How to Remove Unused JavaScript Files on WordPress\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/wp-rocket.me\/#website\",\"url\":\"https:\/\/wp-rocket.me\/\",\"name\":\"WP Rocket\",\"description\":\"Plugin d&#039;optimisation de sites WordPress\",\"publisher\":{\"@id\":\"https:\/\/wp-rocket.me\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/wp-rocket.me\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/wp-rocket.me\/#organization\",\"name\":\"WP Rocket\",\"url\":\"https:\/\/wp-rocket.me\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/wp-rocket.me\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/logo-wp-rocket-paypal-2.png\",\"contentUrl\":\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/logo-wp-rocket-paypal-2.png\",\"width\":150,\"height\":41,\"caption\":\"WP Rocket\"},\"image\":{\"@id\":\"https:\/\/wp-rocket.me\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/pages\/WP-Rocket\/631942253526829\",\"https:\/\/x.com\/wp_rocket\",\"https:\/\/www.youtube.com\/channel\/UC1ozThXHd1IWIZ5wkshgp_Q\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Remove Unused JavaScript on WordPress","description":"Want to understand how to remove unused JavaScript on WordPress and improve your PageSpeed Insights score? Find out all the information you need on WP Rocket!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/remove-unused-javascript\/","og_locale":"en_US","og_type":"article","og_title":"How to Remove Unused JavaScript on WordPress","og_description":"Want to understand how to remove unused JavaScript on WordPress and improve your PageSpeed Insights score? Find out all the information you need on WP Rocket!","og_url":"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/remove-unused-javascript\/","og_site_name":"WP Rocket","article_publisher":"https:\/\/www.facebook.com\/pages\/WP-Rocket\/631942253526829","article_modified_time":"2024-06-24T10:46:08+00:00","og_image":[{"url":"https:\/\/wp-rocket.me\/wp-content\/uploads\/2021\/06\/reduce-unused-js.png"}],"twitter_card":"summary_large_image","twitter_site":"@wp_rocket","twitter_misc":{"Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/remove-unused-javascript\/","url":"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/remove-unused-javascript\/","name":"How to Remove Unused JavaScript on WordPress","isPartOf":{"@id":"https:\/\/wp-rocket.me\/#website"},"primaryImageOfPage":{"@id":"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/remove-unused-javascript\/#primaryimage"},"image":{"@id":"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/remove-unused-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/wp-rocket.me\/wp-content\/uploads\/2021\/06\/reduce-unused-js.png","datePublished":"2021-04-21T12:56:31+00:00","dateModified":"2024-06-24T10:46:08+00:00","description":"Want to understand how to remove unused JavaScript on WordPress and improve your PageSpeed Insights score? Find out all the information you need on WP Rocket!","breadcrumb":{"@id":"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/remove-unused-javascript\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/remove-unused-javascript\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/remove-unused-javascript\/#primaryimage","url":"https:\/\/wp-rocket.me\/wp-content\/uploads\/2021\/06\/reduce-unused-js.png","contentUrl":"https:\/\/wp-rocket.me\/wp-content\/uploads\/2021\/06\/reduce-unused-js.png","width":1148,"height":862},{"@type":"BreadcrumbList","@id":"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/remove-unused-javascript\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/wp-rocket.me"},{"@type":"ListItem","position":2,"name":"Core Web Vitals","item":"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/"},{"@type":"ListItem","position":3,"name":"Interaction to Next Paint","item":"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/improve-interaction-to-next-paint\/"},{"@type":"ListItem","position":4,"name":"How to Remove Unused JavaScript Files on WordPress"}]},{"@type":"WebSite","@id":"https:\/\/wp-rocket.me\/#website","url":"https:\/\/wp-rocket.me\/","name":"WP Rocket","description":"Plugin d&#039;optimisation de sites WordPress","publisher":{"@id":"https:\/\/wp-rocket.me\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wp-rocket.me\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/wp-rocket.me\/#organization","name":"WP Rocket","url":"https:\/\/wp-rocket.me\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wp-rocket.me\/#\/schema\/logo\/image\/","url":"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/logo-wp-rocket-paypal-2.png","contentUrl":"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/logo-wp-rocket-paypal-2.png","width":150,"height":41,"caption":"WP Rocket"},"image":{"@id":"https:\/\/wp-rocket.me\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/pages\/WP-Rocket\/631942253526829","https:\/\/x.com\/wp_rocket","https:\/\/www.youtube.com\/channel\/UC1ozThXHd1IWIZ5wkshgp_Q"]}]}},"_links":{"self":[{"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/core_web_vitals_hub\/3300520"}],"collection":[{"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/core_web_vitals_hub"}],"about":[{"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/types\/core_web_vitals_hub"}],"wp:attachment":[{"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/media?parent=3300520"}],"wp:term":[{"taxonomy":"core_web_vitals","embeddable":true,"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/core_web_vitals?post=3300520"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}