• Resolved olisimoes

    (@olisimoes)


    In an attempt to reduce unused JS, I excluded some of them from processing, but for some reason they’re still showing in the source code as well as in DevTools. I tried to use both absolute URLs and relative URLs, but neither one worked. Any thoughts on this? Also, what would be the correct way of listing this URL, for example? ttps://masterportuguesetranslator.com/wp-content/cache/wpo-minify/1746805307/assets/wpo-minify-footer-googlesitekit-modules-adsense1746727838.min.js

    Thank you all for your time.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Support Damilare

    (@deabiodun)

    Hi @olisimoes!
    Sorry it took a while to respond to you.

    The Exclude JavaScript from processing feature/field is meant to exclude Javascript files present in included path from being merged or minified. It does not treat them as unused for the purpose of excluding such files.
    In addition, what should be excluded is the original JS file/path and not already processed (already minified) version like in your case. This helps to eliminate JS conflicts that could have arisen from merging/minifying.

    Having said that, the correct way to use this feature is by entering the path to any JS file you want excluded (one per line). Like in your example, if we assume that the original sitekit js path is /wp-content/plugins/google-site-kit/assets/sitekit.js, then you are to add /wp-content/plugins/google-site-kit/assets/sitekit.js to the Exclude JavaScript… field in order to exclude sitekit.js from processing (merging or minify). Alternatively, you can leave it as /wp-content/plugins/google-site-kit/assets/ to exclude any JS file in the assets path from processing.

    One thing you should note though is that cache files like the one in your example path have dynamic names. When the cache is cleared or expires, a new one is generated. Once that happens, that path will become invalid as the directory/file …/1746805307/…1746727838.min.js may no longer exist.

    Therefore, when dealing with dynamically generated paths, it might be best to exclude the static section of the path that will not change.

    Hope that helps.

    Feel free to keep in touch if you have further questions.

    Kind regards.

Viewing 1 replies (of 1 total)

The topic ‘Excluded JS still showing in source code’ is closed to new replies.