Title: Scripts and Styles Loading on Every Page (Bloatware)
Last modified: September 18, 2020

---

# Scripts and Styles Loading on Every Page (Bloatware)

 *  Resolved [jetxpert](https://wordpress.org/support/users/jetxpert/)
 * (@jetxpert)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/scripts-loading-on-every-page-bloatware/)
 * Hi there,
 * Your plugin is loading scripts and styles on website pages that don’t require
   The Events Calendar.
 * For example, our homepage does not have anything close to needing The Event Calendar
   yet it’s loading the [following files](http://prntscr.com/ujjicm):
 * `/wp-content/plugins/the-events-calendar/vendor/jquery-placeholder/jquery.placeholder.
   min.js`
 * **File Size:** 2.1 KB
 * `/wp-content/plugins/the-events-calendar/common/src/resources/css/common-skeleton.
   min.css`
 * **File Size:** 25.9 KB
 * `/wp-content/plugins/the-events-calendar/common/src/resources/css/tooltip.min.
   css`
 * **File Size:** 1.6 KB
 * `/wp-content/plugins/the-events-calendar/src/resources/css/admin-menu.min.css`
 * **File Size:** .3 KB
 * Please update your plugin to fix the above. Until then, would appreciate a php
   snippet that will dequeue assets (css and js files) on website pages that don’t
   use The Events Calendar.
 * Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Thread Starter [jetxpert](https://wordpress.org/support/users/jetxpert/)
 * (@jetxpert)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/scripts-loading-on-every-page-bloatware/#post-13424324)
 * **Useful Tip:**
 * We need a snippet [similar this one](https://clicknathan.com/web-design/removing-woocommerce-scripts-and-styles/),
   but for The Events Calendar.
 *  Plugin Author [Gustavo Bordoni](https://wordpress.org/support/users/bordoni/)
 * (@bordoni)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/scripts-loading-on-every-page-bloatware/#post-13424631)
 * Hi [@jetxpert](https://wordpress.org/support/users/jetxpert/),
 * We were taking a look at the problem here on this other topic.
 * [https://wordpress.org/support/topic/loads-on-every-page-slows-website/](https://wordpress.org/support/topic/loads-on-every-page-slows-website/)
 * This is a duplicate of that correct?
 * As I told you on the other thread for the file `jquery-placeholder` we do not
   enqueue on all pages, tho because of the order of actions we are the first plugin
   registering it so when someone else includes `jquery-placeholder` the file included
   is ours. It can even be your theme doing it.
 * The files `common-skeleton.min.css` and `tooltip.min.css` were an oversight by
   the development team and are indeed being included on every page.
 * I’ve already created a Pull Request for a solution for that problem, but it might
   be too late for the release we are going to put out next week since we need to
   do testing on that modification before it goes out.
 * [https://github.com/moderntribe/tribe-common/pull/1445](https://github.com/moderntribe/tribe-common/pull/1445)
 * As per the last file, `admin-menu` that one is only enqueued everywhere due to
   the WordPress admin menu if you are logged out that should not happen.
 * Only the last one is intentionally being included on all pages, sorry to see 
   that you think it’s bloatware, it definitely not intentional.
 * Best Regards,
 *  Thread Starter [jetxpert](https://wordpress.org/support/users/jetxpert/)
 * (@jetxpert)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/scripts-loading-on-every-page-bloatware/#post-13425384)
 * Hi [@bordoni](https://wordpress.org/support/users/bordoni/),
 * Thanks for the detailed reply. Much appreciated.
 * Previous topic was opened as “unique” because de-queuing the placeholder js file
   was impacting our website and needed a “focused” reply. In any case, will avoid
   submitting topics that appear duplicated.
 * The term “bloatware” was used because your plugin loads files (software) on pages
   that do not use (nor depend on) your plugin. Your fix will take care of this.
 * If you don’t mind, can you ask your developers to come up with a snippet similar
   to the one provided above? Would be a nice tool to have and ascertain all unnecessary
   files are either not loaded or are dequeued.
 * Looking forward to your update.
 * Thank you!
 *  Thread Starter [jetxpert](https://wordpress.org/support/users/jetxpert/)
 * (@jetxpert)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/scripts-loading-on-every-page-bloatware/#post-13425418)
 * **Good News:**
 * I believe we found the snippet we were looking for.
 * Click here: [https://gist.github.com/samkent/b98bd3c9b28426b8461bc1417adf7b5d](https://gist.github.com/samkent/b98bd3c9b28426b8461bc1417adf7b5d)
 * Can you confirm it works at your end – or update it if necessary? (using a development
   or test website)
 * Thank you!
 *  Thread Starter [jetxpert](https://wordpress.org/support/users/jetxpert/)
 * (@jetxpert)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/scripts-loading-on-every-page-bloatware/#post-13425642)
 * **Update:**
 * We confirmed the GitHub snippet provided above gets the job done. It works!
 * We added the following CSS and JS files to the above script for a complete clean-
   up (i.e., dequeue all scripts and styles on pages where calendar or events are
   not used).
 * **Under “Calendar Styles”:**
 * `wp_dequeue_style('tribe-events-admin-menu');`
 * **Note:** Admin Menu (back-end) not impacted by the above. File deleted at the
   front-end without impacting back-end style.
 * **Under “Calendar Scripts”:**
 * `wp_dequeue_script('jquery-placeholder');`
 * **Note:** For those who need to know, in order to use the above snippet, please
   download and install the plugin, Code Snippets. Run the snippet as “Run snippet
   everywhere.” (you will see this option in the back-end after you install the 
   plugin)
 * Must admit, GitHub rocks (and its contributors).
 * Cheers!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Scripts and Styles Loading on Every Page (Bloatware)’ is closed to new
replies.

 * ![](https://ps.w.org/the-events-calendar/assets/icon-256x256.gif?rev=2516440)
 * [The Events Calendar](https://wordpress.org/plugins/the-events-calendar/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/the-events-calendar/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/the-events-calendar/)
 * [Active Topics](https://wordpress.org/support/plugin/the-events-calendar/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/the-events-calendar/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/the-events-calendar/reviews/)

## Tags

 * [bloatware](https://wordpress.org/support/topic-tag/bloatware/)
 * [css](https://wordpress.org/support/topic-tag/css/)
 * [dequeue](https://wordpress.org/support/topic-tag/dequeue/)
 * [js](https://wordpress.org/support/topic-tag/js/)
 * [snippet](https://wordpress.org/support/topic-tag/snippet/)

 * 5 replies
 * 2 participants
 * Last reply from: [jetxpert](https://wordpress.org/support/users/jetxpert/)
 * Last activity: [5 years, 7 months ago](https://wordpress.org/support/topic/scripts-loading-on-every-page-bloatware/#post-13425642)
 * Status: resolved