{"id":16675,"date":"2018-09-14T14:28:59","date_gmt":"2018-09-14T12:28:59","guid":{"rendered":"https:\/\/belvg.com\/blog\/?p=16675"},"modified":"2025-02-11T13:22:01","modified_gmt":"2025-02-11T11:22:01","slug":"how-to-defer-javascript-loading-for-magento-2","status":"publish","type":"post","link":"https:\/\/belvg.com\/blog\/how-to-defer-javascript-loading-for-magento-2.html","title":{"rendered":"How to Defer JavaScript Loading for Magento 2"},"content":{"rendered":"<p>Time is a valuable resource and no one wants to spend it meaninglessly waiting for something. It is true for online shopping just like for everything else. You will not find customers that will be happy to wait minutes for a page to load. Loading speed is a parameter too important to be ignored. It should be optimized and improved constantly with all the known methods. That&#8217;s why we have developed the Defer JS extension for Magento 2 to speed up your online store.<\/p>\n<p><!--more--><\/p>\n<h2><strong><span style=\"color: #000000;\">About Defer JS<\/span><\/strong><\/h2>\n<p>Have you ever thought how browsers load website pages? Right, from top to bottom. But the point is that JavaScript is usually located at the top of the page. It may slow down the loading speed, because of delays in HTML and CSS loading. To avoid this we suggest to move the script to the bottom of the page. We have created the Defer JS module to automate this process. <strong>The working principle<\/strong> is simple: the extension defers JavaScript parsing and loading until HTML and CSS files are loaded.<\/p>\n<p><strong>Key features of the extension:<\/strong><\/p>\n<ul>\n<li>compatibility with Magento 2;<\/li>\n<li>understandable interface and configurations;<\/li>\n<li>two built-in filters to exclude certain controllers and pages from deference.<\/li>\n<\/ul>\n<h3><strong><span style=\"color: #000000;\">Benefits for merchants<\/span><\/strong><\/h3>\n<p>Our speed optimization extension prevents you from making code changes manually because you will get them done automatically. As a result, you receive a super fast online shop. And not only customers will appreciate it. Webstore speed is very important for SEO and positions in Google search results. The sooner you boost the webstore and improve the Google PageSpeed score, the higher your positions will be. The higher your positions are, the more customers (i.e. sales) you will get. So what are you waiting for?<\/p>\n<p>Check out <a href=\"https:\/\/store.belvg.com\/defer-js-for-magento-2-0.html\" target=\"_blank\" rel=\"noopener\">the Defer JS extension<\/a> in our <a href=\"https:\/\/store.belvg.com\/\" target=\"_blank\" rel=\"noopener\">Magento store<\/a>.<\/p>\n<div class='module_in_content_container'><a href='https:\/\/belvg.com\/magento2-development' class='link_to_module' target='_blank' rel='noopener'><\/a><div class='module_content'><div class='module_content_part'><h3 class='title'>Magento 2 Development<\/h3><p class='module_content_text'>Take your online store to the next level with BelVG Magento 2 Development <\/p><a href='https:\/\/belvg.com\/magento2-development' class='link_2_to_module' target='_blank' style='display:inline-block' rel='noopener'><span class='read-more'>Visit the page<\/span><\/a><\/div><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"The extension to boost online store","protected":false},"author":102,"featured_media":16681,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"image","meta":{"_acf_changed":false,"footnotes":""},"categories":[475,491,389],"tags":[],"class_list":["post-16675","post","type-post","status-publish","format-image","has-post-thumbnail","hentry","category-belvg-live","category-magento-2","category-magento2-development","post_format-image"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.4 - aioseo.com -->\n\t<meta name=\"description\" content=\"Speed up Magento 2-based webstores with a new BelVG extension. Meet Defer JS, developed to defer parsing and loading of JavaScript and prioritize HTML and CSS loading.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Darya Monastyrskaya\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/belvg.com\/blog\/how-to-defer-javascript-loading-for-magento-2.html\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.4\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-defer-javascript-loading-for-magento-2.html#article\",\"name\":\"Defer JS Extension for Magento 2 | BelVG Blog\",\"headline\":\"How to Defer JavaScript Loading for Magento 2\",\"author\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/dasha-m#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/09\\\/How-to-Defer-JavaScript-Loading-for-Magento-2.jpg\",\"width\":1110,\"height\":590,\"caption\":\"Defer JS extension for Magento 2\"},\"datePublished\":\"2018-09-14T14:28:59+02:00\",\"dateModified\":\"2025-02-11T13:22:01+02:00\",\"inLanguage\":\"en-US\",\"commentCount\":2,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-defer-javascript-loading-for-magento-2.html#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-defer-javascript-loading-for-magento-2.html#webpage\"},\"articleSection\":\"BELVG LIVE, Magento 2, Magento 2 Development, Image\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-defer-javascript-loading-for-magento-2.html#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/belvg.com\\\/blog\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento2-development#listItem\",\"name\":\"Magento 2 Development\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento2-development#listItem\",\"position\":2,\"name\":\"Magento 2 Development\",\"item\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento2-development\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-defer-javascript-loading-for-magento-2.html#listItem\",\"name\":\"How to Defer JavaScript Loading for Magento 2\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-defer-javascript-loading-for-magento-2.html#listItem\",\"position\":3,\"name\":\"How to Defer JavaScript Loading for Magento 2\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento2-development#listItem\",\"name\":\"Magento 2 Development\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#organization\",\"name\":\"BelVG Blog\",\"description\":\"Magento and Prestashop articles\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/dasha-m#author\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/dasha-m\",\"name\":\"Darya Monastyrskaya\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-defer-javascript-loading-for-magento-2.html#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/28b29b718ed4c89fdf9f3f024e76e42b5611c29dee49d6303faa7ce8354a8fc5?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Darya Monastyrskaya\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-defer-javascript-loading-for-magento-2.html#webpage\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-defer-javascript-loading-for-magento-2.html\",\"name\":\"Defer JS Extension for Magento 2 | BelVG Blog\",\"description\":\"Speed up Magento 2-based webstores with a new BelVG extension. Meet Defer JS, developed to defer parsing and loading of JavaScript and prioritize HTML and CSS loading.\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-defer-javascript-loading-for-magento-2.html#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/dasha-m#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/dasha-m#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/09\\\/How-to-Defer-JavaScript-Loading-for-Magento-2.jpg\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-defer-javascript-loading-for-magento-2.html\\\/#mainImage\",\"width\":1110,\"height\":590,\"caption\":\"Defer JS extension for Magento 2\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-defer-javascript-loading-for-magento-2.html#mainImage\"},\"datePublished\":\"2018-09-14T14:28:59+02:00\",\"dateModified\":\"2025-02-11T13:22:01+02:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/\",\"name\":\"BelVG Blog\",\"description\":\"Magento and Prestashop articles\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Defer JS Extension for Magento 2 | BelVG Blog","description":"Speed up Magento 2-based webstores with a new BelVG extension. Meet Defer JS, developed to defer parsing and loading of JavaScript and prioritize HTML and CSS loading.","canonical_url":"https:\/\/belvg.com\/blog\/how-to-defer-javascript-loading-for-magento-2.html","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/belvg.com\/blog\/how-to-defer-javascript-loading-for-magento-2.html#article","name":"Defer JS Extension for Magento 2 | BelVG Blog","headline":"How to Defer JavaScript Loading for Magento 2","author":{"@id":"https:\/\/belvg.com\/blog\/author\/dasha-m#author"},"publisher":{"@id":"https:\/\/belvg.com\/blog\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2018\/09\/How-to-Defer-JavaScript-Loading-for-Magento-2.jpg","width":1110,"height":590,"caption":"Defer JS extension for Magento 2"},"datePublished":"2018-09-14T14:28:59+02:00","dateModified":"2025-02-11T13:22:01+02:00","inLanguage":"en-US","commentCount":2,"mainEntityOfPage":{"@id":"https:\/\/belvg.com\/blog\/how-to-defer-javascript-loading-for-magento-2.html#webpage"},"isPartOf":{"@id":"https:\/\/belvg.com\/blog\/how-to-defer-javascript-loading-for-magento-2.html#webpage"},"articleSection":"BELVG LIVE, Magento 2, Magento 2 Development, Image"},{"@type":"BreadcrumbList","@id":"https:\/\/belvg.com\/blog\/how-to-defer-javascript-loading-for-magento-2.html#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/#listItem","position":1,"name":"Home","item":"https:\/\/belvg.com\/blog\/","nextItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/category\/magento2-development#listItem","name":"Magento 2 Development"}},{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/category\/magento2-development#listItem","position":2,"name":"Magento 2 Development","item":"https:\/\/belvg.com\/blog\/category\/magento2-development","nextItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/how-to-defer-javascript-loading-for-magento-2.html#listItem","name":"How to Defer JavaScript Loading for Magento 2"},"previousItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/how-to-defer-javascript-loading-for-magento-2.html#listItem","position":3,"name":"How to Defer JavaScript Loading for Magento 2","previousItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/category\/magento2-development#listItem","name":"Magento 2 Development"}}]},{"@type":"Organization","@id":"https:\/\/belvg.com\/blog\/#organization","name":"BelVG Blog","description":"Magento and Prestashop articles","url":"https:\/\/belvg.com\/blog\/"},{"@type":"Person","@id":"https:\/\/belvg.com\/blog\/author\/dasha-m#author","url":"https:\/\/belvg.com\/blog\/author\/dasha-m","name":"Darya Monastyrskaya","image":{"@type":"ImageObject","@id":"https:\/\/belvg.com\/blog\/how-to-defer-javascript-loading-for-magento-2.html#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/28b29b718ed4c89fdf9f3f024e76e42b5611c29dee49d6303faa7ce8354a8fc5?s=96&d=mm&r=g","width":96,"height":96,"caption":"Darya Monastyrskaya"}},{"@type":"WebPage","@id":"https:\/\/belvg.com\/blog\/how-to-defer-javascript-loading-for-magento-2.html#webpage","url":"https:\/\/belvg.com\/blog\/how-to-defer-javascript-loading-for-magento-2.html","name":"Defer JS Extension for Magento 2 | BelVG Blog","description":"Speed up Magento 2-based webstores with a new BelVG extension. Meet Defer JS, developed to defer parsing and loading of JavaScript and prioritize HTML and CSS loading.","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/belvg.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/belvg.com\/blog\/how-to-defer-javascript-loading-for-magento-2.html#breadcrumblist"},"author":{"@id":"https:\/\/belvg.com\/blog\/author\/dasha-m#author"},"creator":{"@id":"https:\/\/belvg.com\/blog\/author\/dasha-m#author"},"image":{"@type":"ImageObject","url":"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2018\/09\/How-to-Defer-JavaScript-Loading-for-Magento-2.jpg","@id":"https:\/\/belvg.com\/blog\/how-to-defer-javascript-loading-for-magento-2.html\/#mainImage","width":1110,"height":590,"caption":"Defer JS extension for Magento 2"},"primaryImageOfPage":{"@id":"https:\/\/belvg.com\/blog\/how-to-defer-javascript-loading-for-magento-2.html#mainImage"},"datePublished":"2018-09-14T14:28:59+02:00","dateModified":"2025-02-11T13:22:01+02:00"},{"@type":"WebSite","@id":"https:\/\/belvg.com\/blog\/#website","url":"https:\/\/belvg.com\/blog\/","name":"BelVG Blog","description":"Magento and Prestashop articles","inLanguage":"en-US","publisher":{"@id":"https:\/\/belvg.com\/blog\/#organization"}}]}},"aioseo_meta_data":{"post_id":"16675","title":"Defer JS Extension for Magento 2 | #site_title","description":"Speed up Magento 2-based webstores with a new BelVG extension. Meet Defer JS, developed to defer parsing and loading of JavaScript and prioritize HTML and CSS loading.","keywords":[{"label":"online","value":"online"},{"label":"web","value":"web"},{"label":"store","value":"store"},{"label":"shop","value":"shop"},{"label":"magento","value":"magento"},{"label":"2","value":"2"},{"label":"defer","value":"defer"},{"label":"js","value":"js"},{"label":"JavaScript","value":"JavaScript"},{"label":"loading","value":"loading"},{"label":"parsing","value":"parsing"},{"label":"extension","value":"extension"},{"label":"module","value":"module"},{"label":"speed","value":"speed"},{"label":"optimization","value":"optimization"},{"label":"boost","value":"boost"},{"label":"html","value":"html"},{"label":"css","value":"css"},{"label":"google","value":"google"},{"label":"PageSpeed","value":"PageSpeed"},{"label":"score","value":"score"}],"keyphrases":null,"focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_custom_url":null,"og_image_custom_fields":null,"og_image_url":null,"og_image_width":null,"og_image_height":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_image_url":null,"twitter_title":null,"twitter_description":null,"schema_type":"default","schema_type_options":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null,"created":"2026-11-03 18:37:04","updated":"2026-11-03 18:37:04"},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/belvg.com\/blog\/\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/belvg.com\/blog\/category\/magento2-development\" title=\"Magento 2 Development\">Magento 2 Development<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tHow to Defer JavaScript Loading for Magento 2\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/belvg.com\/blog\/"},{"label":"Magento 2 Development","link":"https:\/\/belvg.com\/blog\/category\/magento2-development"},{"label":"How to Defer JavaScript Loading for Magento 2","link":"https:\/\/belvg.com\/blog\/how-to-defer-javascript-loading-for-magento-2.html"}],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts\/16675","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/users\/102"}],"replies":[{"embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/comments?post=16675"}],"version-history":[{"count":0,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts\/16675\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/media\/16681"}],"wp:attachment":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/media?parent=16675"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/categories?post=16675"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/tags?post=16675"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}