-1

My page speed is suffering from unused javascript. I am using the Perfmatters plugin. IN Perfmatters, you can list the javascript for each page.

Is there a list somewhere of what each of these Wordpress related javascripts do? Or is there a tool that will tell me which ones are unneeded on my site? I would do trial and error but that always backfires.

I'd love to know which of these I can just turn off.

Thanks!

enter image description here

3
  • That tool may not be accurate, those JS files may not be used on the page you tested but do get used elsewhere, and deleting the files will cause lots of issues as a lot of those are used in the admin area. Never modify wp-includes or wp-admin folders. Also 3rd party plugin support/dev support questions are offtopic here, you should ask Perfmatters about these things, especially since turning off a script is not something you can normally do
    – Tom J Nowell
    Commented Mar 10, 2022 at 1:48
  • Right. But if I had a list of what each script is used for, I could know which are not needed on my website. For example, the shortcode script. An explanation might be, "Needed if you are using shortcodes, not needed if you're not using shortcodes. BEfore turning off, double check that your plugins/theme aren't using shortcode." or there's a dashicons script. Or wp-block-library which I think is for Gutenberg, an explanation could be, "This is used in Gutenberg. It is unnecessary if you are not using Gutenberg." Commented Mar 14, 2022 at 0:52
  • there are no lists of what are safe to disable and enable, the answer to this question is ultra specific and unique to you and your site, and the scripts themselves don't operate on such a high level basis. You can't know for sure if a script is used by shortcodes, or a specific shortcode, or your theme, or multiple things. The only reliably choices you have are reading the code manually or testing it and seeing if things break. Some you can get clues by googling them. Trial and error is the only real reliably answer anybody can give here that works for everybody.
    – Tom J Nowell
    Commented Mar 14, 2022 at 10:46

1 Answer 1

0

Is there a list somewhere of what each of these Wordpress related javascripts do?

There is no comprehensive list that does this, and many of those items would not appear on it as they're not WordPress internal files or may be required by non-WordPress files to function. Those files may be built to require them even if they don't always use their contents.

Or is there a tool that will tell me which ones are unneeded on my site?

I believe you've already used that tool and it told you there was lots of unused javascript. Keep in mind that just because it was unused, doesn't mean it isn't in use. A person who has only ever seen a bedroom may consider a bath or shower an unused and unnecessary item in a house by this logic.

I would do trial and error but that always backfires.

This is the only method available to you that can give you certainty.

Fundamentally, the real question is why you have so many javascript files being loaded in the first place. Using this plugin to block them being loaded is a patch/workaround at best that doesn't address the root problem or poorly built plugins/themes or too many plugins on your site. Assuming there was a problem at all, not all tools provide useful answers, many can make misleading recommendations based on out of date practices or missing context.

Also, there is no guarantee that the list in your screenshot is a list of files that are being loaded. This looks like a full list of everything WordPress has, even the things that are only loaded in WP-Admin. Many of those toggles will make zero difference to your frontend performance as they were never loaded to begin with.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.