Back to Support Plugins and Integrations Troubleshooting The Page Optimize Plugin

Troubleshooting The Page Optimize Plugin

The Page Optimize plugin is automatically installed on plugin-enabled sites on WordPress.com. This advanced guide explains the steps to exclude specific JavaScript files from being concatenated by the Page Optimize plugin.

This feature is available on sites with the WordPress.com Creator or Entrepreneur plan. If your site has one of our legacy plans, it is available on the Pro plan.

About the Page Optimize Plugin

The Page Optimize plugin includes features that may improve how quickly browsers can load your website:

Please bear in mind that while these optimizations may improve your site’s loading times, Page Optimize is not guaranteed to improve them and should not be considered an alternative to ensuring your code is performant.

The Page Optimize plugin is automatically installed on WordPress.com sites with a plugin-eligible plan. The Page Optimize plugin can be deactivated like any other plugin.

Exclude JS From Concatenation

If you notice activating the Page Optimize plugin appears to be negatively impacting your site’s performance, you may perform these debugging steps to identify files to exclude from JS concatenating:

  1. Deactivate the Page Optimize plugin from Plugins → Installed Plugins.
  2. Load the problematic page on your website.
  3. Open your browser’s inspector tool and select the Console tab.
  4. Look for errors relating to Javascript files (.js). In this example, an error occurred in the eu-cookie-law-min.js file:
The JS file is highlighted in red.
  1. Reactivate the Page Optimize plugin from Plugins → Installed Plugins.
  2. View the source code of the webpage (right-click > View Page Source).
  3. Find the data-handle of the script
  4. Add the data-handle in the exclusion list

Data-Handle

The data-handle is the unique slug used by the WordPress software to identify plugins, themes, CSS, and Javascript files. Before you can add something to the exclusion list, you must find out the data-handle of the Javascript file. To do this, view the source code of the webpage and look for the <script> tag that contains the data handles. It will look something like:

<script data-handles='mediaelement-migrate,eu-cookie-law-script' type='text/javascript'></script>

Using your browser’s Find tool will make it easier to find the tag. Press Ctrl+F (Windows) or Cmd+F (Mac) on your keyboard and search for <script data-handles

By looking at the tag, you should be able to find the data-handle of the offending script. In our example, it’s eu-cookie-law-script.

Exclusion List

The exclusion list is a list of data-handles that are ignored by the plugin, meaning they are not going to be concatenated.

To add something to the exclusion list:

  1. From your site’s dashboard, navigate to Settings → Performance (or Jetpack → Settings → Performance if using WP-Admin).
  2. Under Performance & speed, click “Optimize JS and CSS for faster page load and render in the browser.

If you do not see the link to “Optimize JS and CSS…” make sure the Page Optimize plugin is active by visiting Plugins → Installed Plugins.

The setting for "Optimize JS and CSS for faster page load and render in the browser" is marked with an arrow.
You can also add /wp-admin/admin.php?page=page-optimize to your domain to access this setting
  1. In the space under “Comma separated list of strings to exclude from JS concatenating:” enter the data-handle preceded by a comma:
The example of eu-cookie-law-script is added to the box.
  1. Click the “Save Changes” button.

Additional Troubleshooting

If the above steps do not help, try the following:

Was this guide helpful for you?

Not quite what you're looking for? Get Help!

Copied to clipboard!