Title: Excluding CSS class from caching
Last modified: October 23, 2021

---

# Excluding CSS class from caching

 *  Resolved [aff1o](https://wordpress.org/support/users/aff1o/)
 * (@aff1o)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/excluding-css-class-from-caching/)
 * Hey there!
 * We have Autoptimize used on our site and the plugin works wonderfully.
 * Recently however, we’ve been receiving CLS issues from Google Search Console,
   which are directly linked to a single element on our page (a phone number that’s
   fixed to the top right of the page, when the page loads, the element jumps from
   the top left to top right which I believe it due to the way things are being 
   cached).
 * Is there any guidance of how to either exclude the CSS classes we’ve got for 
   it, or perhaps making a tiny CSS file with the snippets of CSS used in the element,
   then excluding that?
 * Thank you!

Viewing 12 replies - 1 through 12 (of 12 total)

 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/excluding-css-class-from-caching/#post-14999488)
 * Exclusion in AO works by excluding CSS-files or inline CSS from being aggregated,
   excluding by CSS class however is not possible.
 * I would advise to first try to confirm the issue is with CSS optimization by 
   just disabling that (or if not CSS it could also be JS or HTML or Image optimization(
   incl. lazyload), so try disabling each option you have active one by one).
 * Based on that we can see what the next steps need to be 🙂
 * frank
 *  Thread Starter [aff1o](https://wordpress.org/support/users/aff1o/)
 * (@aff1o)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/excluding-css-class-from-caching/#post-15002578)
 * Morning Frank!
 * I have indeed tried disabling the plugin on staging and she element loaded without
   jumping around.
 * Looking forward to your thoughts on next steps – thank you!
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/excluding-css-class-from-caching/#post-15002818)
 * OK, but does the element load without jumping around when Autoptimize is enabled
   but CSS optimization is off?
 *  Thread Starter [aff1o](https://wordpress.org/support/users/aff1o/)
 * (@aff1o)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/excluding-css-class-from-caching/#post-15010639)
 * Hi Frank,
 * No, the element does not jump around when Autoptimize is enabled, but CSS optimization
   is turned off.
 * Only when CSS optimization is turned on!
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/excluding-css-class-from-caching/#post-15010650)
 * OK, are “also aggregate inline CSS” and “remove render-blocking CSS” on or off?
 *  Thread Starter [aff1o](https://wordpress.org/support/users/aff1o/)
 * (@aff1o)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/excluding-css-class-from-caching/#post-15011150)
 * Thank you – both of those options are on currently.
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/excluding-css-class-from-caching/#post-15011172)
 * OK, does the problem persist when “remove render-blocking CSS” is off?
 *  Thread Starter [aff1o](https://wordpress.org/support/users/aff1o/)
 * (@aff1o)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/excluding-css-class-from-caching/#post-15011182)
 * That appears to have fixed the jumping 🙂 That’s super thank you
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/excluding-css-class-from-caching/#post-15011233)
 * OK, now did you supply “above the fold CSS” or are you using the “critical CSS”
   integration?
 *  Thread Starter [aff1o](https://wordpress.org/support/users/aff1o/)
 * (@aff1o)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/excluding-css-class-from-caching/#post-15011236)
 * We’re using the Critical CSS integration
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/excluding-css-class-from-caching/#post-15011269)
 * OK In that case reach out for their support to help you configure things to ensure
   the jump does not happen or -as a shortcut- share your URL here and I’ll try 
   guide you.
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/excluding-css-class-from-caching/#post-15026360)
 * I’ll close the thread here as I assume you have contacted criticalcss.com support
   aff1o?
 * have a nice day!
    frank

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Excluding CSS class from caching’ is closed to new replies.

 * ![](https://ps.w.org/autoptimize/assets/icon-256X256.png?rev=2211608)
 * [Autoptimize](https://wordpress.org/plugins/autoptimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/autoptimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/autoptimize/)
 * [Active Topics](https://wordpress.org/support/plugin/autoptimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/autoptimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/autoptimize/reviews/)

 * 12 replies
 * 2 participants
 * Last reply from: [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * Last activity: [4 years, 7 months ago](https://wordpress.org/support/topic/excluding-css-class-from-caching/#post-15026360)
 * Status: resolved