An Unload site-wide (everywhere) rule already removes the asset from every page. Use a load exception when the asset must remain available in a narrower context.

When a stylesheet or JavaScript file is marked as Unload site-wide (everywhere), Asset CleanUp removes that asset throughout the website.

Because the asset is already unloaded on every page, adding another unload rule for a narrower context would not change the result. Asset CleanUp therefore hides or disables redundant unload controls and gives you two useful choices: remove the global rule or keep it and add a load exception.

Quick Navigation

How Rule Priority Works

Asset CleanUp evaluates unload rules and load exceptions in the following practical order:

  1. Unload rules determine whether an asset should be removed.
  2. A site-wide unload covers every page, so narrower unload rules cannot remove the asset any further.
  3. Load exceptions are evaluated after unload rules.
  4. When a matching load exception exists, it takes priority and keeps the asset loaded in that context.
Load exceptions always take priority over unload rules, including an Unload site-wide (everywhere) rule.

Why Other Unload Rules Are Unavailable

While a site-wide unload is active, the following narrower unload rules are redundant:

  • Unload on this page
  • Unload on all pages of a post type
  • Unload when a taxonomy condition is matched
  • Unload when the request URI matches a RegEx rule

For example, if example-style is unloaded everywhere, an additional rule to unload it on one page cannot alter the output. It is already unloaded on that page.

For this reason, the CSS & JS Manager displays the following notice:

All other unload rules (e.g. per page, RegEx) are overwritten by this site-wide rule.

This is expected behavior and does not indicate that previously saved rules or settings were lost.

Option 1: Remove the Site-Wide Rule

Use this approach when the asset should remain loaded by default and should only be removed from selected pages or groups of pages.

  1. Open CSS & JS Manager on a page where the asset is listed.
  2. Locate the stylesheet or JavaScript handle.
  3. In the site-wide rule box, select Remove site-wide rule.
  4. Click Update to save the change.
  5. Reload the CSS & JS Manager.
  6. Choose the narrower unload rule that matches the intended behavior.
  7. Click Update again.

After removing the global rule, you can use options such as:

  • Unload on this page
  • Unload on all pages of the current post type
  • a taxonomy-based unload rule
  • a request URI / RegEx unload rule

Option 2: Keep the Site-Wide Rule and Add a Load Exception

Use this approach when the asset should be removed from most of the website but must remain loaded in a limited number of contexts.

  1. Keep Unload site-wide (everywhere) active.
  2. In the same asset row, locate Make an exception from any unload rule & always load it.
  3. Select the exception that describes where the asset is required.
  4. Click Update.
  5. Clear page, optimization and CDN caches when applicable.
  6. Test both a matching page and a page where the exception should not apply.
A load exception does not create another copy of the asset. It prevents the matching handle from being removed by an unload rule in the selected context.

Available Load Exceptions

Depending on the current page context and plugin edition, the available exceptions can include:

  • On this page
  • On all pages of the current post type
  • If the user is logged in
  • Post-type taxonomy conditions
  • Request URI / RegEx conditions
  • Taxonomy, author and other archive contexts supported by Asset CleanUp Pro

Choose the Narrowest Suitable Exception

Use On this page when the asset is required on one specific page. Use a post-type, taxonomy or RegEx exception only when the asset is required across a predictable group of pages.

Some advanced contextual, taxonomy and RegEx rules are available only in Asset CleanUp Pro.

Example Workflows

Unload an Asset Only on One Page

Desired result: the asset should load normally and be removed only from one landing page.

  1. Remove the site-wide unload rule.
  2. Open the CSS & JS Manager for the landing page.
  3. Select Unload on this page.
  4. Save and test the page.

Unload an Asset Everywhere Except on Product Pages

Desired result: the asset should remain unloaded across the site but load on WooCommerce product pages.

  1. Keep Unload site-wide (everywhere).
  2. In the load-exception area, select On all WooCommerce Product pages.
  3. Save the changes.
  4. Test one product page and one non-product page.

Unload an Asset Everywhere Except for Logged-In Users

Desired result: visitors should not receive the asset, but authenticated users still require it.

  1. Keep the site-wide unload rule.
  2. Select If the user is logged in under load exceptions.
  3. Save the changes.
  4. Test once while logged in and once in a private browser window.

Important Notes

  • A load exception is useful only when an unload rule would otherwise remove the asset.
  • If all unload rules for a handle are removed, its load exceptions become unnecessary because the asset loads by default.
  • A matching load exception wins when unload and load-exception conditions overlap.
  • Each rule applies to the asset handle shown in that row. The same file could be registered under another handle.
  • Logged-in administrators can satisfy exceptions or receive different cached HTML than regular visitors.
  • Review obsolete exceptions after removing broad unload rules to keep the configuration easy to troubleshoot.

How to Verify the Result

  1. Clear the Asset CleanUp cache if CSS/JS optimization is enabled.
  2. Clear the active page-cache or hosting-cache layer.
  3. Clear or invalidate the CDN cache when applicable.
  4. Open a private/incognito browser window.
  5. Test a page where the asset should load.
  6. Test a page where the asset should remain unloaded.
  7. Inspect the page source or browser Network panel and search for the asset URL or handle.

When using If the user is logged in, always perform separate logged-in and logged-out tests.

Troubleshooting

The Narrower Unload Controls Are Still Unavailable

Confirm that Remove site-wide rule was selected and that Update was clicked. Reload the manager after saving. If the site-wide notice remains visible, check whether the same handle has another global rule in Bulk Changes or Overview.

The Asset Still Loads After a Site-Wide Unload

Check the always load it section for a matching load exception. A per-page, post-type, logged-in-user, taxonomy or RegEx exception can override the global unload. Clear all applicable caches and test while logged out.

The Asset Is Missing Where It Is Required

Add the narrowest suitable load exception. Prefer On this page for one page and a post-type or taxonomy exception when the same asset is required across a predictable group of pages.

Old Load Exceptions Remain After Removing the Unload Rule

Load exceptions no longer affect an asset that is loaded by default, but obsolete rules can make future troubleshooting harder. Remove unused exceptions from the asset row, Overview, or the appropriate bulk-rule management screen.

Was this post helpful?