Skip to main content
KadiCache
Browse 37 Docs Guides & Search

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.

WP Admin -> KadiCache -> CSS & JavaScript -> Safelist & ExclusionsWP Admin -> KadiCache -> Cloud Connection
WP Admin -> KadiCache -> CSS & JavaScript -> RUCSS Safelist Modal
MODULE 13 · 2X RETINA
Fine-grain RUCSS exclusions and wildcard selector safelists preserve dynamic third-party widgets without disabling CSS optimization.1158×848 WebP
Quick Summary · 30-Second Operational SpecSource-Verified Guide
WP Admin Path
WP Admin -> KadiCache -> CSS & JavaScript -> Safelist & Exclusions
Expected Outcome
3 Granular Rule Tabs · Exact & Prefix * Matching
Key Marker / Engine
Pages | Stylesheets | Selectors & safelist
  • Provides three targeted override scopes inside Safelist & Exclusions: Pages (keep original CSS on a URL), Stylesheets (keep one .css file 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:

  1. 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 .css file.
  2. 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.
  3. 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.
FIG 01Configuring Pages, Stylesheets, and Selectors & safelist rules inside WP Admin -> KadiCache -> CSS & JavaScriptZoom 2x

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 TabGranularitySyntax 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. StylesheetsFile-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. PagesRoute-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:

  1. 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=1 or after clicking Use original CSS on this page on a staging test.
  2. 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).
  3. 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).
TEXTCopy-Paste Selector & Stylesheet Safelist Examples
# 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?
Watch what happens in Incognito: if the widget never opens or never responds when clicked until you move your mouse/tap twice, that is JavaScript timing (check Delay JS Exclusions). If the widget opens immediately on click, but its fonts, colors, or borders look unstyled even after clicking, add its class prefix to RUCSS Selectors & safelist!
Can I put multiple asterisks in the middle of a rule, like .shop-*-card?
Rules inside Safelist & Exclusions accept either an exact value (.shop-promo-card) or a single final * for prefix matching (.shop-*). Keeping matching prefix-based makes evaluation fast and predictable.
If I exclude one stylesheet in the Stylesheets tab, is it still minified?
Yes, if Minify CSS files is enabled (and that stylesheet is not also excluded in local Minify CSS exclusions), KadiCache still strips whitespace and comments while preserving 100% of its selectors.
Do Page exclusions inside Remove Unused CSS support prefix wildcards for child pages?
Yes! Adding /courses/* under Pages using original CSS excludes /courses/ and every nested lesson URL beneath /courses/ while keeping image optimization and page caching active.
Do I lose my safelist rules if I click Relearn and rebuild?
Never! Your Pages, Stylesheets, and Selectors & safelist rules are saved permanently in your KadiCache configuration—clicking Relearn and rebuild simply generates fresh CSS output honoring all of your saved safelist rules.
Gergis — Lead Systems & Cache Architect
Principal WordPress & Cloud Edge Architect
E-E-A-T Source Verified

Creator of KadiCache’s Early PHP Drop-In, 7-Driver Object Cache Engine, Cloud Remove Unused CSS, and Zero-CLS Lazy Render pipeline.

WP Admin -> KadiCache -> CSS & JavaScript -> Safelist & ExclusionsWP Admin -> KadiCache -> Cloud Connection
Was this engineering guide helpful?