Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter anzgar

    (@anzgar)

    It looks like this only happens on the shop page for some reason.

    As this page isn’t really important for my visitors, I might just leave it the way it is. However I would still like to know if there is a way to find out which JS or CSS files can be dequeued safely.

    Thanks ??

    Hi there,

    those Javascript files should not be loaded outside of the admin.
    So something on your site, whether it be a plugin or another function is loading them on the frontend.
    You would need to find what is doing that by disabling plugins and custom functions.

    Thread Starter anzgar

    (@anzgar)

    Thanks a lot for that information. Removing the content from that page an readding it solved it somehow.

    Is there however a generic approach on how to find out if a specific JS/CSS file is necessary?

    You can use the developers tools coverage tab to check to see if 0% of a script is being used in a page – see here:

    https://developer.chrome.com/docs/devtools/coverage

    But generally you need to know what the script is doing and whether it is necessary.

    In the same developers tools Network tab you can see the scripts path, it will give you an idea whats loading it, eg. a Plugin directory. From which you may be able to determine whether its needed on a specific page.

    Thread Starter anzgar

    (@anzgar)

    Alright, so there is no easy way ??
    Thanks a lot!

    Theres no quick way of doing it.
    I generally audit the network tab to see if new plugins are adding scripts unnecessarily. Then use functions or a plugin like PerfMatters to disable them where they are not required.

    Glad to be of help.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Which JS to dequeue?’ is closed to new replies.