{"id":1091145,"date":"2016-03-18T12:51:01","date_gmt":"2016-03-18T19:51:01","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-scriptsstyles-on-pages-they-shouldnt-be-loading\/"},"modified":"2016-08-29T15:29:55","modified_gmt":"2016-08-29T22:29:55","slug":"removing-scriptsstyles-on-pages-they-shouldnt-be-loading","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-scriptsstyles-on-pages-they-shouldnt-be-loading\/","title":{"rendered":"Removing Scripts\/Styles on pages they shouldn&#8217;t be loading"},"content":{"rendered":"<p>Greetings,<\/p>\n<p>I&#8217;d like a function to dequeue all scripts\/styles related to the events calendar on all pages but the Calendar and individual event listings. I had such a function before, but it seems the events calendar is loading yet more assets onto pages it ought not to, and so I&#8217;ve returned looking for a solution again.<\/p>\n<p>There ought to be an option in the plugin to disable loading event calendar assets on pages other than what we approve. <strong>This option should never break going forwards<\/strong>. When we deploy The Events Calendar to many client sites, spending significant time optimizing those sites, only to months later return to these sites to find that stylesheets and javascript files we did not approve are now being loaded on the HOMEPAGE, and that a javascript file enqueued in the header (where it should never be) also forced the jQuery library we had moved to the footer back to the header where it blocks rendering, that is an outrage. Not only do we need a solution to this, now we have to go back and deploy that solution to every effected website.<\/p>\n<p><strong>Please consider the pain this causes developers<\/strong>. I look forwards to hearing a solution, and I hope that solution can be made a permanent fixture so that we may continue deploying the Events Calendar to dozens more sites going into the future.<\/p>\n<p>The current assets being inserted without my consent bogging down my homepage are as follows:<\/p>\n<p><code><br \/>\n&lt;link rel='stylesheet' id='widget-this-week-pro-style-css'  href='http:\/\/site.com\/wp-content\/plugins\/theeventscalendar.compu_request_pluginevents-calendar-proversion4.1pu_get_download1pue_active_version4.0-h3e2e3\/src\/resources\/css\/widget-this-week-full.css' type='text\/css' media='all' \/&gt;<\/p>\n<p>&lt;link rel='styleshee<br \/>\nt' id='tribe_events-widget-this-week-pro-style-css'  href='http:\/\/site.com\/wp-content\/plugins\/theeventscalendar.compu_request_pluginevents-calendar-proversion4.1pu_get_download1pue_active_version4.0-h3e2e3\/src\/resources\/css\/widget-this-week-theme.min.css' type='text\/css' media='all' \/&gt;<br \/>\n&lt;script type='text\/javascript'&gt;<\/p>\n<p>\/* &lt;![CDATA[ *\/<br \/>\nvar tribe_this_week = {\"ajaxurl\":\"http:\\\/\\\/site.com\\\/wp-admin\\\/admin-ajax.php\"};<br \/>\n\/* ]]&gt; *\/<br \/>\n&lt;\/script&gt;<\/p>\n<p>&lt;script type='text\/javascript' src='http:\/\/site.com\/wp-content\/plugins\/theeventscalendar.compu_request_pluginevents-calendar-proversion4.1pu_get_download1pue_active_version4.0-h3e2e3\/src\/resources\/js\/widget-this-week.min.js'&gt;&lt;\/script&gt;<\/code><\/p>\n","protected":false},"template":"","class_list":["post-1091145","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Removing Scripts\/Styles on pages they shouldn&#039;t be loading -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-scriptsstyles-on-pages-they-shouldnt-be-loading\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Removing Scripts\/Styles on pages they shouldn&#039;t be loading -\" \/>\n<meta property=\"og:description\" content=\"Greetings, I&#8217;d like a function to dequeue all scripts\/styles related to the events calendar on all pages but the Calendar and individual event listings. I had such a function before, but it seems the events calendar is loading yet more assets onto pages it ought not to, and so I&#8217;ve returned looking for a solution [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-scriptsstyles-on-pages-they-shouldnt-be-loading\/\" \/>\n<meta property=\"article:modified_time\" content=\"2016-08-29T22:29:55+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-scriptsstyles-on-pages-they-shouldnt-be-loading\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-scriptsstyles-on-pages-they-shouldnt-be-loading\/\",\"name\":\"Removing Scripts\/Styles on pages they shouldn't be loading -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2016-03-18T19:51:01+00:00\",\"dateModified\":\"2016-08-29T22:29:55+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-scriptsstyles-on-pages-they-shouldnt-be-loading\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-scriptsstyles-on-pages-they-shouldnt-be-loading\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-scriptsstyles-on-pages-they-shouldnt-be-loading\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Calendar Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Events Calendar PRO\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Removing Scripts\/Styles on pages they shouldn&#8217;t be loading\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Removing Scripts\/Styles on pages they shouldn't be loading -","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:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-scriptsstyles-on-pages-they-shouldnt-be-loading\/","og_locale":"en_US","og_type":"article","og_title":"Removing Scripts\/Styles on pages they shouldn't be loading -","og_description":"Greetings, I&#8217;d like a function to dequeue all scripts\/styles related to the events calendar on all pages but the Calendar and individual event listings. I had such a function before, but it seems the events calendar is loading yet more assets onto pages it ought not to, and so I&#8217;ve returned looking for a solution [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-scriptsstyles-on-pages-they-shouldnt-be-loading\/","article_modified_time":"2016-08-29T22:29:55+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-scriptsstyles-on-pages-they-shouldnt-be-loading\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-scriptsstyles-on-pages-they-shouldnt-be-loading\/","name":"Removing Scripts\/Styles on pages they shouldn't be loading -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2016-03-18T19:51:01+00:00","dateModified":"2016-08-29T22:29:55+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-scriptsstyles-on-pages-they-shouldnt-be-loading\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-scriptsstyles-on-pages-they-shouldnt-be-loading\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-scriptsstyles-on-pages-they-shouldnt-be-loading\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Calendar Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/"},{"@type":"ListItem","position":4,"name":"Events Calendar PRO","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/"},{"@type":"ListItem","position":5,"name":"Removing Scripts\/Styles on pages they shouldn&#8217;t be loading"}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1091145","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":2,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1091145\/revisions"}],"predecessor-version":[{"id":1157309,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1091145\/revisions\/1157309"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1091145"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}