Title: Css optimized appears inside comment html and dont render
Last modified: February 5, 2017

---

# Css optimized appears inside comment html and dont render

 *  Resolved [sarr9121](https://wordpress.org/support/users/sarr9121/)
 * (@sarr9121)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/css-optimized-appears-inside-comment-html-and-dont-render/)
 * Hi, I’m trying to use autoptimize. My main web page is [https://colsalud.com](https://colsalud.com).
   When applying css optimization the page does not apply any style. I have created
   a clone of the page to do tests [https://clon.colsalud.com](https://clon.colsalud.com)
   and I discovered when reviewing the source code of the page that all code minimized
   by optimize corresponding to the css appears inside comment html (<- – ->), for
   that reason does not load any style. Could you help me figure out why this happens?
   First I thought it was wp super cache; Disable it and continue the error; Then
   I thought it was the security plugin, disable wordfence and continue the error.

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

 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/css-optimized-appears-inside-comment-html-and-dont-render/#post-8742326)
 * hi [@sarr9121](https://wordpress.org/support/users/sarr9121/);
    on clon.colsasud.
   com you seem to be using something to defer CSS loading which seems to be somehow
   breaking Autoptimize’s optimization. can you disable that so I can see what AO
   does?
 * frank
 *  Thread Starter [sarr9121](https://wordpress.org/support/users/sarr9121/)
 * (@sarr9121)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/css-optimized-appears-inside-comment-html-and-dont-render/#post-8743203)
 * Hi Frank. thanks for your prompt response. I have disabled the css defer plugin
   on the clone site. I’m using the in line css option. And the page does not load
   the css. Everything appears as html comment.
 * Santiago.
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/css-optimized-appears-inside-comment-html-and-dont-render/#post-8743267)
 * this is (normally) not something AO does, looks like a plugin conflict. can you
   selectively disable other plugins (and briefly switch themes) to identify the
   culprit?
 * fran
 *  Thread Starter [sarr9121](https://wordpress.org/support/users/sarr9121/)
 * (@sarr9121)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/css-optimized-appears-inside-comment-html-and-dont-render/#post-8743671)
 * Hello Frank, apparently it is something related to the theme, I have changed 
   to the typical themes of wordpress and the plugin works. I know it’s not your
   theme, but you have an idea that could cause this block?
 * Thanks.
 * Santiago.
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/css-optimized-appears-inside-comment-html-and-dont-render/#post-8743766)
 * not really, should see the code … is this a theme on [https://wordpress.org/themes](https://wordpress.org/themes)?
 *  Thread Starter [sarr9121](https://wordpress.org/support/users/sarr9121/)
 * (@sarr9121)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/css-optimized-appears-inside-comment-html-and-dont-render/#post-8743819)
 * Not, is a theme from themeforest.
    [https://themeforest.net/item/health-plus-health-clinic-wordpress-theme/12244953](https://themeforest.net/item/health-plus-health-clinic-wordpress-theme/12244953)
 * i wrote to the support page, but i still waiting for some answer.
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/css-optimized-appears-inside-comment-html-and-dont-render/#post-8743827)
 * well, as all theme’s (and plugins) are GPL you are allowed to share the code,
   so … 🙂
 *  Thread Starter [sarr9121](https://wordpress.org/support/users/sarr9121/)
 * (@sarr9121)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/css-optimized-appears-inside-comment-html-and-dont-render/#post-8743911)
 * ok i dont have problem with that. but how share you the code? all the folder 
   have about 18 MB. or what file you need to see?
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/css-optimized-appears-inside-comment-html-and-dont-render/#post-8743928)
 * zip the folder, upload it somewhere and send me the link via mail (futtta-at-
   gmail-dot-com)?
 *  Thread Starter [sarr9121](https://wordpress.org/support/users/sarr9121/)
 * (@sarr9121)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/css-optimized-appears-inside-comment-html-and-dont-render/#post-8746086)
 * Hi frank, sorry for the delay in sending, but I had to leave outside, and only
   so far I could return. I share you the compressed folder via mail. Any help you
   can give me will thank you.
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/css-optimized-appears-inside-comment-html-and-dont-render/#post-8748172)
 * no problem 🙂
 * so the problem is that healthplus outputs this;
 *     ```
       <!-- <title></title>-->
       		<title>futtta's local testblog – Just another WordPress site</title>
       ```
   
 * and that autoptimize injects the optimized CSS in front of the (first) title-
   tag it finds, which due to the healthplus code is inside the HTML-remark’ed block.
 * root cause fix would be for the theme dev to remove that unneeded HTML comment
   block.
 * workaround fix is to tell AO to inject the optimized CSS elsewhere using a coupld
   of lines of code against AO’s API, e.g.;
 *     ```
       add_filter('autoptimize_filter_css_replacetag','fix_healthplus_css');
       function fix_healthplus_css() {
         return array("<!-- <title>","before");
       }
       ```
   
 * (do take into account that this will only work as long as healthplus has the 
   comment-block there, it might be safer to inject elsewhere after all)
 * frank
 *  Thread Starter [sarr9121](https://wordpress.org/support/users/sarr9121/)
 * (@sarr9121)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/css-optimized-appears-inside-comment-html-and-dont-render/#post-8748741)
 * Bravoooooo, you are a Master.
 * Thankyou very much for your help.
    Now I have to test the plugin to improve the
   loading times of the page. Above all, try the inline and defer function, thanks
   again.

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

The topic ‘Css optimized appears inside comment html and dont render’ 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: [sarr9121](https://wordpress.org/support/users/sarr9121/)
 * Last activity: [9 years, 4 months ago](https://wordpress.org/support/topic/css-optimized-appears-inside-comment-html-and-dont-render/#post-8748741)
 * Status: resolved