RUCSS Safelist, Exclusions & Fixing Dynamic Widget Styles
Identify dynamic third-party widget classes in seconds and use Pages, Stylesheets, and Selectors & Safelist wildcard rules without disabling CSS optimization.
- Provides three targeted override scopes inside Safelist & Exclusions: Pages (keep original CSS on a URL), Stylesheets (keep one
.cssfile intact), and Selectors & safelist (preserve dynamic classes/IDs). - Supports clean exact values and single trailing
*prefix wildcards (such as.om-holder*,#hubspot-*, or/custom-builder/*)—one rule per line, zero complex regex syntax required. - Includes a 1-click frontend Admin Bar -> KadiCache -> Use original CSS on this page toggle for instant per-page isolation during visual QA.
- Lets you fix late-injected third-party popups, chat widgets, or custom JS classes in under 60 seconds while keeping
95%+CSS savings across the rest of the page.
When Do You Actually Need a Safelist or Exclusion Rule?#
On the vast majority of standard WordPress, Gutenberg, Elementor, Divi, Astra, Kadence, and WooCommerce templates, Cloud Remove Unused CSS preserves active layout rules, hover states, mobile menus, modals, and cart drawers automatically with zero manual configuration.
You typically only need to add a rule inside Safelist & Exclusions in three specific scenarios:
- Late-Loaded External Marketing Popups or Spin-to-Win Wheels: An external Tag Manager script injects DOM elements 15 seconds after page load (or on exit-intent) that rely on classes stored inside a local theme/plugin
.cssfile. - Custom JavaScript State Classes Computed From Strings: A bespoke script builds class names dynamically in JavaScript (for example
element.classList.add('tier-badge-' + userTier)) that only appear after calling an external JSON API. - One-Off Interactive Configurator Pages: A single URL (
/3d-kitchen-planner/) embeds a complex legacy CSS app where keeping original stylesheets on that route alone is simplest.
Choosing the Right Tab: Selectors vs Stylesheets vs Pages#
Clicking Safelist & Exclusions next to Remove unused CSS inside WP Admin -> KadiCache -> CSS & JavaScript opens a three-tab modal. Always prefer the narrowest scope that solves the visual issue so you preserve maximum PageSpeed gains:
| Modal Tab | Granularity | Syntax Examples (One Rule Per Line) | Best Used When... |
|---|---|---|---|
| 1. Selectors & safelist (Best First Choice) | Surgical (adds ~0.5–2 KB) | .is-expanded / .klaviyo-* / #chat-widget* | One dynamic widget, badge, tooltip, or popup lacks styling when triggered |
| 2. Stylesheets | File-level (keeps 1 .css file) | booking-calendar.css / /plugins/calculator/assets/* | A small third-party plugin (15 KB stylesheet) renders dozens of dynamic calendar/form states |
| 3. Pages | Route-level (uses original CSS on URL) | /interactive-floorplan/ / /portal/* | One specialized app page needs unoptimized CSS while the other 500 pages keep RUCSS |
Notice the clean, mistake-proof rule syntax enforced across all three tabs: enter one rule per line using either an exact match or a single final * for prefix matching. You never have to escape regex slashes or debug PCRE syntax errors!
60-Second Workflow: Finding a Missing CSS Selector in Browser Inspect#
If you spot an interactive widget whose border, background, or spacing looks off when Remove Unused CSS is active, here is how to pinpoint and safelist its exact class prefix in under a minute:
- Compare Against Original CSS Instantaneously: Open the page in two browser tabs—Tab A in normal logged-out Incognito (with RUCSS active), and Tab B with
?kadicache_bypass=1or after clicking Use original CSS on this page on a staging test. - Right-Click -> Inspect the Widget: In Tab B (where the widget looks styled), right-click the widget wrapper and click Inspect in Chrome/Firefox/Edge DevTools. Look at the root container’s class prefix in the Elements panel—almost every WordPress plugin namespaces all of its CSS rules under one consistent prefix (for example
.pum-*for Popup Maker,.mec-*for Modern Events Calendar,.wpamelia-*for Amelia Booking, or.jet-popup*for Crocoblock JetPopup). - Add One Prefix Rule & Apply: Open
WP Admin -> KadiCache -> CSS & JavaScript -> Safelist & Exclusions -> Selectors & safelist, type that single prefix with a trailing asterisk (e.g.,.jet-popup*), click Apply, and click Save & Purge (or Relearn and rebuild if updating stored CSS).
# Tab: Selectors & safelist — Common dynamic popup, calendar & custom state prefixes
.pum-*
.jet-popup*
.om-holder*
.cmplz-*
.is-active*
.has-open-modal
# Tab: Stylesheets — Keep one small dynamic plugin stylesheet untouched
amelia-booking.css
/wp-content/plugins/custom-loan-calculator/*
# Tab: Pages — Keep original stylesheets on specific routes only
/custom-product-customizer/*Fast Per-Page Bypass From the Frontend Admin Bar#
Reviewing client pages right before launch and want to exclude a single campaign page on the spot without opening WP Admin? While viewing that live page on the frontend as a logged-in administrator, hover KadiCache in the top WordPress Admin Bar and click Use original CSS on this page (Per-Page Exclusions Guide). KadiCache adds that page’s path cleanly and purges its cached HTML immediately!
Quick Reference: Common WordPress Plugin Class Prefixes#
When integrating external SaaS widgets or dynamic shortcodes that mount DOM nodes asynchronously after initial load, this cheat sheet gives you the exact root class prefix to add under Selectors & safelist if needed:
- Popup & Lead-Capture Plugins:
.pum-*(Popup Maker),.jet-popup*(Crocoblock),.om-holder*(OptinMonster),.klaviyo-*(Klaviyo forms),.hustle-*(Hustle). - Booking, Events & LMS Widgets:
.amelia-*/.wpamelia-*(Amelia),.mec-*(Modern Events Calendar),.tribe-events*(The Events Calendar),.ld-*(LearnDash dynamic modals). - Live Chat & Helpdesk Triggers: Custom theme buttons opening Intercom, Crisp, Tawk.to, or HubSpot chat drawers via
.open-chat*or#support-launcher. - Custom Theme JavaScript Utility States:
.is-open,.is-visible,.is-sticky,.drawer-open,.modal-active, and.has-scrolled.
Frequently Asked Operational Questions
How do I tell whether a broken widget is caused by Remove Unused CSS or Delay JavaScript?
Can I put multiple asterisks in the middle of a rule, like .shop-*-card?
If I exclude one stylesheet in the Stylesheets tab, is it still minified?
Do Page exclusions inside Remove Unused CSS support prefix wildcards for child pages?
Do I lose my safelist rules if I click Relearn and rebuild?
Creator of KadiCache’s Early PHP Drop-In, 7-Driver Object Cache Engine, Cloud Remove Unused CSS, and Zero-CLS Lazy Render pipeline.