There are various ways in using the CSS/JS manager for unloading assets. You can manage it within the Dashboard (which is the most used way and preferred by many as the most effective option) from “CSS & JS Manager” — “Manage CSS/JS” or in the front-end view by enabling “Manage in the Front-end” in “Settings” — “Plugin Usage Preferences” — “CSS/JS Management”.

🟢 Manage assets from the Dashboard (recommended)

The assets within the Dashboard can be managed for the following type of WordPress pages: posts, custom post types (this includes pages such as “product” from WooCommerce), pages (e.g. About us, Contact), taxonomies (this includes “Categories”, “Tags”, “Product categories” (WooCommerce), etc.). Any other pages such as “Search” (e.g. /?s=keyword), “Date Archives” (e.g. /2020/01/), etc, will have to be managed from the front-end (e.g. you visit the actual “Search” results page and scroll to the bottom and access the CSS/JS list loaded on this page (“Manage in the Front-end” will have to be enabled).

There are two ways of fetching the actual CSS/JS list from the Dashboard (e.g. to unload CSS/JS files that are loading on various pages) which is the “Direct” (as if the admin is viewing the page) and “WP Remote POST” (as if a guest is viewing the page) options.

Direct * as if the admin is viewing the page
The retrieved list has all the assets that are loaded for you, the logged-in admin c they are the same ones that you can notice when you view the source of the HTML page when you are logged-in. This is the default way of fetching because in most scenarios the CSS/JS is loaded for everyone (including the admin) and specific assets are loaded for the admin only. Thus, this list is the most relevant.

WP Remote POST * as if a guest is viewing the page
This method uses the “wp_remote_post” WordPress function used to retrieve the assets and in this case it’s like the server of the hosting company is accessing the list and it does it as a guest. This method is useful if you know there are assets that are loaded (the developers of those plugins made it this way) for a guest, but never loaded for the admin. For instance, there might be a popup loading (that has CSS/JS files) just for a guest visitor. Or a tracker such as Google Analytics (that was excluded to load when an admin is visiting the page to avoid recoding its actions), etc. Or, a portion of the page that is styled just for the guest visitor (e.g. asking him/her to join a membership) and that style is loading from a CSS file never loading for the logged-in admin.

Note that this method would be irrelevant if the post/page is set as “private” and can’t be viewed by guests. If that’s the case, the “Direct” method will be used as a fallback.

Where’s the CSS/JS manager printed for this option?
The easiest way to access it is via “CSS & JS Manager” — “Manage CSS/JS” and then choose the type of pages for which you want it to load.

Another way is to actually access it whenever you edit a post/page/custom post type or a taxonomy (e.g. a “Category”). Just make sure the following option is kept active: ‘Settings’ — ‘Plugin Usage Preferences’ — ‘Show “Asset CleanUp Pro: CSS & JavaScript Manager / Page Options” meta box’. Note that some people prefer to have this turned off because it could add too much clutter to the edit post/page area (e.g. there are already other meta boxes generated by other plugins).

🟢 Manage assets from the front-end view (alternative)

This option is good in case you have issues with the first one (e.g. in case the retrieval of the assets from the Dashboard fails) or you need to manage the assets for pages such as Search (e.g. /?s=keyword), Date (the list of posts based on the date), Author (the list of posts written by a specific author) and 404 Not Found.

Where’s the CSS/JS manager printed for this option?
If the option is enabled (“Manage in the Front-end“), it will shown the CSS/JS manager at the bottom of each page you visit as a logged-in admin.

Was this post helpful?