Code Unloader – Unload Unused CSS, JS & Assets Per Page

Descripcion

Code Unloader is a free WordPress asset manager and script manager that lets you unload unused plugin CSS and JavaScript (JS) on selected pages without writing PHP. Unload assets where a page does not need them and keep them everywhere else. Reduce HTTP requests and page weight by loading files only where they are needed, which improves page speed and performance scores, with a one-click kill switch and per-request bypass for quick rollback.

One WordPress.org user unloaded eight JavaScript files and two CSS files from the homepage, reducing it by 634.2 KB and improving PageSpeed from 96 to 99. Results vary by site and depend on which assets can be safely unloaded.

Read the review:
https://wordpress.org/support/topic/very-good-increases-pagespeed/

Common uses

  • Unload contact-form CSS and JavaScript from pages without a form
  • Stop WooCommerce assets from loading on pages that do not use shop features
  • Unload slider, sharing, popup, or page-builder files where they are not needed
  • Unload JS and CSS only for mobile visitors, or only for desktop
  • Create different asset rules for desktop and mobile visitors
  • Apply rules to one URL, a group of URLs, post types, or conditional page types

How it works

  1. Open any frontend page while logged in as an administrator.
  2. Click ⚡ Assets in the WordPress Admin Toolbar.
  3. Find a CSS or JavaScript file and switch it off.
  4. Choose where the rule should apply: an exact URL, wildcard pattern, regular expression, device type, or condition.
  5. Save the rule, clear page cache if needed, and test the page.

The frontend panel groups assets by plugin, theme, or WordPress Core, making it easier to see what is loading and where it came from.

Official plugin homepage:
https://wpservice.pro/our-products/code-unloader/

Unload assets per page: scripts, styles and plugin files

WordPress registers each script and stylesheet by handle, and most plugins enqueue theirs on every page. Code Unloader dequeues those handles on the pages you choose, so a form script, slider stylesheet or page-builder bundle loads only where it is used. It works on registered files from plugins, themes and WordPress core alike, and shows you the file’s source before you unload it.

Main features

  • Unload registered CSS and JavaScript on selected pages or across matching URLs
  • Exact URL, wildcard (/shop/*), and regular-expression matching
  • Conditions for logged-in users, WooCommerce pages, shortcodes, and post types
  • Desktop-only and mobile-only asset rules
  • Rule groups, global rule management, audit log, and JSON import/export
  • One-click kill switch that restores all assets without deleting any rules
  • Per-request ?nowpcu bypass for testing the unoptimized page
  • Detection of inline <script> and <style> blocks for easier investigation

Safe, reversible testing

Every rule can be disabled or deleted. If an unloaded file affects the page, append ?nowpcu to the URL to bypass all Code Unloader rules for that request. You can also use the global kill switch to restore every asset sitewide while keeping your rules saved.

Test unloading changes on a staging site first whenever possible. Removing a required CSS or JavaScript file can affect a page’s appearance or functionality.

Compatibility

Code Unloader is designed to work alongside common caching, optimization, e-commerce, and page-builder plugins, including WP Rocket, W3 Total Cache, LiteSpeed Cache, WP Super Cache, WooCommerce, Elementor, Divi, and WPBakery Page Builder.

PHP 8.0 or higher is required.

Screenshots

Installacion

  1. In WordPress, go to Plugins > Add New Plugin and search for Code Unloader.
  2. Click Install Now, then Activate.
  3. Visit any frontend page while logged in as an administrator.
  4. Click ⚡ Assets in the Admin Toolbar.
  5. Switch off an asset and choose where the unloading rule should apply.
  6. Test the page’s design and functionality after saving the rule.

FAQ

Does Code Unloader remove unused CSS inside a stylesheet?

No. Code Unloader unloads an entire registered CSS file on pages that do not need it. It does not remove individual unused selectors from inside a stylesheet.

Can I unload plugin CSS and JavaScript without writing code?

Yes. Open the frontend asset panel, switch off the asset, and choose where the rule should apply. You do not need to add PHP snippets or edit theme files.

How do I unload JavaScript (JS) or CSS on one page only?

Open that page with ⚡ Assets in the Admin Toolbar, switch the file off, and choose exact URL as the match. The rule dequeues the file on that page only; every other page keeps loading it.

Can I unload assets on mobile only, or desktop only?

Yes. Each rule has a device setting: all visitors, mobile only, or desktop only. A mobile-only rule leaves the desktop page untouched.

Can unloading an asset break a page?

Yes. A page can lose styling or functionality if you unload a required dependency. Test each change, preferably on staging. Use ?nowpcu for a one-request bypass or the kill switch to restore all assets immediately.

Will my rules survive a cache flush or plugin reactivation?

Yes. Rules are stored in a custom database table and are not removed when plugin caches are cleared or Code Unloader is reactivated.

What is the kill switch?

The kill switch is an emergency recovery option in Settings > Code Unloader > Settings. When active, all rules are bypassed and every asset loads normally. Your rules are not deleted and resume when you deactivate the kill switch.

What does the ?wpcu parameter do?

Append ?wpcu to a frontend URL to open the asset panel for logged-in administrators, including on pages where the Admin Toolbar is hidden. The parameter remains while the panel is open and is removed when you close it.

What does the ?nowpcu parameter do?

Append ?nowpcu to a URL to bypass all Code Unloader rules for that request. The page loads as if Code Unloader were not applying any rules. This is useful for testing, debugging, and comparing optimized and unoptimized asset loading.

Does it support wildcard and regular-expression rules?

Yes. Choose an exact URL, wildcard pattern, or regular expression when creating a rule. Regular expressions are validated before saving.

Can it unload inline script and style blocks?

The Inline Blocks tab detects and lists <script> and <style> tags printed directly into the page HTML. It helps you identify inline code, but those blocks cannot currently be unloaded from the frontend panel.

Does Code Unloader replace a caching or minification plugin?

No. Code Unloader controls whether a registered CSS or JavaScript file loads on a matching page. Caching and minification plugins change how files are stored or delivered. They can be used together.

What PHP version do I need?

PHP 8.0 or higher. The plugin will not activate on PHP 7.x.

Reviews

12 abril 2026 2 replies
I've just started using this plugin and have already unloaded 8 JavaScripts and two css files that were slowing down the loading of my front page, saving 634.2KB. PageSpeed up from 96 to 99.
Read all 1 review

Contributors & Developers

“Code Unloader – Unload Unused CSS, JS & Assets Per Page” is open source software. The following people have contributed to this plugin.

Contributors

“Code Unloader – Unload Unused CSS, JS & Assets Per Page” has been translated into 1 locale. Thank you to the translators for their contributions.

Translate “Code Unloader – Unload Unused CSS, JS & Assets Per Page” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.

Changelog

1.4.12

  • Changed: the AI Assets Scanner sidebar card now links to Dr. Speed: AI Assets Scanner on WordPress.org.
  • Changed: readme wording for the plugin directory search (unload assets, unload JS and CSS per page, page speed); « Tested up to » corrected to 7.1.

1.4.11

  • Added: filter the Rules tab by URL. A new URL/Group switch sits at the top of the rules list; pick a URL to see only the rules stored for that page. The list opens on « All URLs ».
  • Changed: the rules toolbar now filters by URL or by Group, one at a time, instead of by Group only.
  • Changed: tested WordPress compatibility updated to 7.1 and plugin version bumped to 1.4.11.
  • Changed: reworded the AI Assets Scanner sidebar card.

For the complete release history, see changelog.txt in the plugin folder.