Title: Can&#8217;t exclude css file
Last modified: December 5, 2017

---

# Can’t exclude css file

 *  Resolved [joncampbell](https://wordpress.org/support/users/joncampbell/)
 * (@joncampbell)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/cant-exclude-css-file/)
 * I am using an enfold child theme and when I try to exclude desktop.css it doesn’t
   seem to be excluded.
 * I tried
    desktop.css assets/css/desktop.css assets/css/desktop
 * The file is at /wp-content/themes/enfold-child/assets/css/desktop.css
 * It doesn’t seem to make much sense but by having the desktop file autoptimized
   its messing with a bunch of styling.
    Thanks,

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

 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/cant-exclude-css-file/#post-9750981)
 * should work just fine normally. can you share your URL so I can have a look [@joncampbell](https://wordpress.org/support/users/joncampbell/)?
 *  Thread Starter [joncampbell](https://wordpress.org/support/users/joncampbell/)
 * (@joncampbell)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/cant-exclude-css-file/#post-9751021)
 * We had to turn the plugin off because of the issues.
    I am just testing it on
   my local.
 * It seems to ignore any of the theme css files I put in the exclude box.
 * Heres what I have in there right now:
    admin-bar.min.css, dashicons.min.css, 
   assets/css/desktop, mobile-landscape.css, tablet-portrait.css
 * But desktop.css, mobile-landscape.css, and tablet-portrait.css are all still 
   being combined and optimized.
 * I have cleared the cache when saving and also manually on the specific page.
   
   Tomorrow I may look and see if i can get any info out of the plugins filters 
   that gives me more details about why the exclusion isn’t happening.
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/cant-exclude-css-file/#post-9751151)
 * OK, keep me posted, I’ll be happy to assist somehow.
 *  Thread Starter [joncampbell](https://wordpress.org/support/users/joncampbell/)
 * (@joncampbell)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/cant-exclude-css-file/#post-9767447)
 * For some reason the css file that is being autoptimized isn’t in the tags that
   run through
 *  if ($this->isremovable($tag,$this->cssremovables)) {
    }
 * that happens within the read() method of autoptimizeStyles.php
 * I output each $tag within the isremovable() method and the tag for desktop.css
   doesn’t seem to show up, but that file does get optimized anyway?
 * What am I missing?
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/cant-exclude-css-file/#post-9767510)
 * hmm … can you copy/paste the excerpt of the HTML where the css-file gets referenced?
 *  Thread Starter [joncampbell](https://wordpress.org/support/users/joncampbell/)
 * (@joncampbell)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/cant-exclude-css-file/#post-9772201)
 * I think I know what the problem is. The css is imported into style.css
    Style.
   css in the theme actually imports 7 other css files.
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/cant-exclude-css-file/#post-9772753)
 * that would indeed be the case, imported CSS is only skipped if it cannot be read
   from the filesystem.

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

The topic ‘Can’t exclude css file’ 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/)

## Tags

 * [css](https://wordpress.org/support/topic-tag/css/)

 * 7 replies
 * 2 participants
 * Last reply from: [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * Last activity: [8 years, 6 months ago](https://wordpress.org/support/topic/cant-exclude-css-file/#post-9772753)
 * Status: resolved