WordPress.org

Ideas

Easier dequeueing or management of unnecessary assets

  1. Jon Dennis
    Member

    12345

    Is there an easier way to dequeue unnecessary assets from those pages that don't need them ? ... I have spent days trying to dequeue assets from pages with no results at all.

    It feels like this option should be a built in part of WordPress ... i.e. Wouldn't it be better to have a template management section, where you could say that only certain templates (or pages) should have assets and scripts queued etc ?

    For instance, why should a simple page have everything thrown at it when that page may only need a few assets to run.

    There are some plugins around that try to do this, but none of them work well, and Plugin Organizer is very out of date and cumbersome.

    In summary, this change would speed up WordPress considerably.

    Posted: 1 year ago #
  2. Ipstenu (Mika Epstein)
    Administrator

    Are you talking about the default WP assets or the ones plugins and themes throw into every page?

    The former, WordPress attempts to only load assets when needed. The latter, yeah, a lot of plugins and themes suck at that.

    Posted: 1 year ago #
  3. Jon Dennis
    Member

    12345

    Hi Ipsetnu

    Thanks for the reply.

    I'm referring to all of them, especially those added by other plugins. It's a nightmare. I've got assets being queued and added to pages which don't need them, which is slowing down pages unncessarily and affecting my SEO.

    Posted: 1 year ago #
  4. Ipstenu (Mika Epstein)
    Administrator

    WordPress itself is exceptionally careful and only adds the JavaScript to pages that need it. Core WP wouldn't be slowing your site down like that. In fact, it does exactly what you're saying. Only load what HAS to b loaded.

    Sadly, plugins and themes will kill ya :/ but there won't be a way to turn off all JS in WP since many things would just break. Which is why the plugins that try suck :/

    Posted: 1 year ago #
  5. Jon Dennis
    Member

    12345

    In theory, i agree with you, but WooCommerce is one of the biggest culprits and from what I saw announced in the news has been bought by Automattic, which means it may presumably become part of WP Core at some point.

    Posted: 1 year ago #
  6. Ipstenu (Mika Epstein)
    Administrator

    It's not ever going to be in core :)

    Posted: 1 year ago #

RSS feed for this topic

Reply

You must log in to post.

  • Rating

    12345
    2 Votes
  • Status

    This idea is under consideration