Title: Sometimes inline CSS should stay inline
Last modified: August 30, 2016

---

# Sometimes inline CSS should stay inline

 *  Resolved [wildmice](https://wordpress.org/support/users/wildmice/)
 * (@wildmice)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/sometimes-inline-css-should-stay-inline/)
 * It’s nice to see that this plugin is doing a thorough job of gathering up the
   inline css and adding it to its single combined css file. However, i have a case
   where, for performance reasons, i am including certain structural css inline.
   It would be nice to have a way of preserving inline css when that is important.
   Perhaps an option on the plugin settings, or some way of marking specific inline
   css so the plugin can get the message to leave it where it is.
 * [https://wordpress.org/plugins/autoptimize/](https://wordpress.org/plugins/autoptimize/)

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

 *  [AJ @ WpFASTER.org](https://wordpress.org/support/users/ajm_1976/)
 * (@ajm_1976)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/sometimes-inline-css-should-stay-inline/#post-6295148)
 * Hi wildmice,
 * You can exclude all inline CSS from aggregation via:
 *     ```
       add_filter('autoptimize_css_include_inline','my_ao_css_include_inline',10,1);
       function my_ao_css_include_inline() {
               return false;
       	}
       ```
   
 * Or, enter the CSS selector for the specific CSS you wish to exclude from aggregation
   into the “Exclude CSS from Autoptimize” field in the AO dashboard.
 * Best,
    AJ
 *  [AJ @ WpFASTER.org](https://wordpress.org/support/users/ajm_1976/)
 * (@ajm_1976)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/sometimes-inline-css-should-stay-inline/#post-6295220)
 * …forgot to mention you could also wrap the CSS you wish to exclude in `<!--noptimize--
   >` tags.
 * E.g.
 *     ```
       <!--noptimize--><style type="text/css">
            #site-title-description {
       position: absolute !important
       clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
       clip: rect(1px, 1px, 1px, 1px);
            }
       </style><!--/noptimize-->
       ```
   
 * Be well,
    AJ
 *  Thread Starter [wildmice](https://wordpress.org/support/users/wildmice/)
 * (@wildmice)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/sometimes-inline-css-should-stay-inline/#post-6295228)
 * Thanks AJ. The noptimize is what i ended up using.
 * The more i use this plugin the more i’m impressed. At the outset i wasn’t expecting
   such depth of detail so didn’t even look for some of these features.
 * What really kind of blew me away was when i tried the option to defer CSS loading–
   loading it via Javascript – and despite the complexity of the page it actually
   worked (aside from the flash of unstyled content).
 *  [AJ @ WpFASTER.org](https://wordpress.org/support/users/ajm_1976/)
 * (@ajm_1976)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/sometimes-inline-css-should-stay-inline/#post-6295235)
 * Frank has created a very special thing with AO and there’s actually very little
   one _can’t_ do when factoring in the API. The icing on the proverbial cake is,
   of course, Frank’s tireless dedication to his creation. It sure doesn’t hurt 
   that he’s just a great guy.
 * > the flash of unstyled content
 * That too can be fixed with AO, my friend. 🙂 You just need to find the CSS critical
   to rendering your above-the-fold content and enter it into the text field provided
   in the UI.
 * Be well,
    AJ
 *  Thread Starter [wildmice](https://wordpress.org/support/users/wildmice/)
 * (@wildmice)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/sometimes-inline-css-should-stay-inline/#post-6295253)
 * Lol, that is where i get off the big G’s bandwagon. I am building sites for *
   all* devices, not just mobile. On some screens *all* the content is above the
   fold, on phones hardly any. “Above the fold” is a futile exercise IMO.

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

The topic ‘Sometimes inline CSS should stay inline’ 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/)

 * 5 replies
 * 2 participants
 * Last reply from: [wildmice](https://wordpress.org/support/users/wildmice/)
 * Last activity: [10 years, 10 months ago](https://wordpress.org/support/topic/sometimes-inline-css-should-stay-inline/#post-6295253)
 * Status: resolved