Title: CSS deleted after disabling Autoptimize
Last modified: March 21, 2022

---

# CSS deleted after disabling Autoptimize

 *  Resolved [naelnewmindsgroup](https://wordpress.org/support/users/naelnewmindsgroup/)
 * (@naelnewmindsgroup)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/css-deleted-after-disabling-autoptimize/)
 * The CSS OF The website especially the fonts gets completely messed up after we
   deactivate AAutoptimize or uncheck the box “_Inline “above the fold CSS” while
   loading the main autoptimized CSS only after page load. Check the FAQ for more
   info. This can be fully automated for different types of pages on the CriticalCSS
   tab._” in the settings. You can see how the styling changes here: [Screenshot](https://drive.google.com/file/d/1q3t7n4M8oNU2Y7aP2cw5vl5wqr3DElEt/view?usp=sharing).
   There’s a code below the checkbox which apparently is a critical path CSS, it
   has a comment that reads: /* Critical Path CSS Generated by Pegasaas Accelerator
   at [https://pegasaas.com/critical-path-css-generator/](https://pegasaas.com/critical-path-css-generator/)
   for [https://supershinexpress.com/](https://supershinexpress.com/) */. How can
   we revert the website’s CSS to its original status?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcss-deleted-after-disabling-autoptimize%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/css-deleted-after-disabling-autoptimize/#post-15481147)
 * I started looking into this, but afraid I’m not there yet naelnewmindsgroup; 
   when I load the page with AO disabled entirely (by adding `?ao_noptimize=1` to
   the URL) I indeed see that the “XPRESS CARWASH” text overlaps and I see that 
   that is not the case when AO is active. I also see that when changing the height
   of the browser window, the text layout changes. Based on this it looks like the
   critical CSS as generated by Pegasaas has responsive CSS that sets the size of
   that text depending on the viewport ans that CSS somehow is not availavble elsewhere(
   which is weird as typically Critical CSS generators do not “invent” CSS, but 
   extract it from the full CSS).
 * I will later tonight/ tomorrow (it’s 21h10 here now) try to identify the “missing
   CSS” based on the critical CSS that is currently in use and get back on the subject,
   but I thought in the meantime above info might already also help you somehow?
 * more soon,
    frank
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/css-deleted-after-disabling-autoptimize/#post-15481320)
 * OK, the missing CSS that makes that text look OK (not overlapping);
 *     ```
       .home-header {
        line-height:16vh!important
       }
       ```
   
 * You could try adding that to Appearance -> Customize -> Extra CSS?
 *  Thread Starter [naelnewmindsgroup](https://wordpress.org/support/users/naelnewmindsgroup/)
 * (@naelnewmindsgroup)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/css-deleted-after-disabling-autoptimize/#post-15482425)
 * Hello, thank you for your reply. But the main issue isn’t only with the text 
   overlapping. If you got to another page, such as [https://supershinexpress.com/services/](https://supershinexpress.com/services/)
   and compare it with [https://supershinexpress.com/services/?ao_noptimize=1](https://supershinexpress.com/services/?ao_noptimize=1)
   you’ll notice how the letter spacing and other font properties are different 
   too, not only in the header but in other elements such as the price table for
   example. How can we restore these properties?
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/css-deleted-after-disabling-autoptimize/#post-15482489)
 * The problem is that the critical CSS as generated by Pegasus has styles that 
   are missing from the current full CSS (both when Autoptimized or in the original
   state), meaning something else was changed (styles removed for some reason, maybe
   by the auto-generated pagebuilder CSS?) since you had Pegasus extract the critical
   CSS.
 * But Autoptimize does not change any of the original CSS (it is replaced on the
   fly in the HTML instead), so this is not something that can be due to/ solved
   by Autoptimize .. :-/
 *  Thread Starter [naelnewmindsgroup](https://wordpress.org/support/users/naelnewmindsgroup/)
 * (@naelnewmindsgroup)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/css-deleted-after-disabling-autoptimize/#post-15483386)
 * Thank you, we are aware of this issue but we don’t have access to the original
   CSS file/Know what happened to it, since as an agency we started working on the
   website recently (This was done by a previous developer). But we’ve noticed that
   the CSS files are stored under autoptimize directories such as:[https://supershinexpress.com/wp-content/cache/autoptimize/css/autoptimize_single_9fdc95d699b22533f32c3a92b63d7ef0.css?ver=5.9.2](https://supershinexpress.com/wp-content/cache/autoptimize/css/autoptimize_single_9fdc95d699b22533f32c3a92b63d7ef0.css?ver=5.9.2).
   And when the plugin is gone, these files are gone too. How are these files generated?
   And Is there a way to retrieve these?
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/css-deleted-after-disabling-autoptimize/#post-15483438)
 * The files are generated from the original CSS; simplified it works like this;
 * 1. Autoptimize gets the full un-optimized HTML from the output buffer
    2. AO 
   searches for all linked or inlined CSS in the HTML and (if not excluded) reads
   the CSS from the original files and combines & minifies & caches it (the 2nd 
   part of the filename is a hash of the CSS after combining but before minifying)
   3. AO then replaces the links to the original CSS in the HTML with the links 
   to the cached optimized CSS
 * So provided the cache has not been cleared, chances are you’ll find older optimized
   CSS in `wp-content/cache/autoptimize/css` maybe and you could try extracting 
   the missing CSS from those (or from the critical CSS as generated by Pegasus)?
 *  Thread Starter [naelnewmindsgroup](https://wordpress.org/support/users/naelnewmindsgroup/)
 * (@naelnewmindsgroup)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/css-deleted-after-disabling-autoptimize/#post-15508289)
 * We found the autoptimize css files in the panel under the directory: wp-content/
   cache/autoptimize/css. We copied the CSS code from the file and pasted it under
   >Appearance> Customize> Additional CSS. It seemed to have solved the problem.
   Thank you for the support!
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/css-deleted-after-disabling-autoptimize/#post-15508579)
 * > We found the autoptimize css files in the panel under the directory: wp-content/
   > cache/autoptimize/css. We copied the CSS code from the file and pasted it under
   > >Appearance> Customize> Additional CSS. It seemed to have solved the problem.
 * that’s a novel approach naelnewmindsgroup, but do keep in mind that it increases
   the amount of CSS used on your site somewhat.
 * > Thank you for the support!
 * you’re welcome, feel free to [leave a review of the plugin and support here](https://wordpress.org/support/plugin/autoptimize/reviews/#new-post)!
   🙂

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

The topic ‘CSS deleted after disabling Autoptimize’ 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/)

 * 8 replies
 * 2 participants
 * Last reply from: [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * Last activity: [4 years, 2 months ago](https://wordpress.org/support/topic/css-deleted-after-disabling-autoptimize/#post-15508579)
 * Status: resolved